Compare commits
8 commits
995564cb5b
...
02eff61a50
Author | SHA1 | Date | |
---|---|---|---|
02eff61a50 | |||
d2037543b0 | |||
41c3fec23f | |||
3a38fbf7fc | |||
64649743e7 | |||
5a31c3cf74 | |||
00bd7d4ff5 | |||
c36b2fa7d8 |
15 changed files with 2197 additions and 211 deletions
3
.dev.env
3
.dev.env
|
@ -7,9 +7,8 @@
|
||||||
# any secret values.
|
# any secret values.
|
||||||
|
|
||||||
BOT_TOKEN=
|
BOT_TOKEN=
|
||||||
BOT_VER=3.1
|
BOT_VER=3.1.1
|
||||||
BOT_AUTHOR=Vylpes
|
BOT_AUTHOR=Vylpes
|
||||||
BOT_DATE=08 May 2023
|
|
||||||
BOT_OWNERID=147392775707426816
|
BOT_OWNERID=147392775707426816
|
||||||
BOT_CLIENTID=682942374040961060
|
BOT_CLIENTID=682942374040961060
|
||||||
|
|
||||||
|
|
38
.github/ISSUE_TEMPLATE/bug_report.md
vendored
38
.github/ISSUE_TEMPLATE/bug_report.md
vendored
|
@ -1,38 +0,0 @@
|
||||||
---
|
|
||||||
name: Bug report
|
|
||||||
about: Create a report to help us improve
|
|
||||||
title: ''
|
|
||||||
labels: bug
|
|
||||||
assignees: ''
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
**Describe the bug**
|
|
||||||
A clear and concise description of what the bug is.
|
|
||||||
|
|
||||||
**To Reproduce**
|
|
||||||
Steps to reproduce the behavior:
|
|
||||||
1. Go to '...'
|
|
||||||
2. Click on '....'
|
|
||||||
3. Scroll down to '....'
|
|
||||||
4. See error
|
|
||||||
|
|
||||||
**Expected behavior**
|
|
||||||
A clear and concise description of what you expected to happen.
|
|
||||||
|
|
||||||
**Screenshots**
|
|
||||||
If applicable, add screenshots to help explain your problem.
|
|
||||||
|
|
||||||
**Desktop (please complete the following information):**
|
|
||||||
- OS: [e.g. iOS]
|
|
||||||
- Browser [e.g. chrome, safari]
|
|
||||||
- Version [e.g. 22]
|
|
||||||
|
|
||||||
**Smartphone (please complete the following information):**
|
|
||||||
- Device: [e.g. iPhone6]
|
|
||||||
- OS: [e.g. iOS8.1]
|
|
||||||
- Browser [e.g. stock browser, safari]
|
|
||||||
- Version [e.g. 22]
|
|
||||||
|
|
||||||
**Additional context**
|
|
||||||
Add any other context about the problem here.
|
|
16
.github/ISSUE_TEMPLATE/epic.md
vendored
16
.github/ISSUE_TEMPLATE/epic.md
vendored
|
@ -1,16 +0,0 @@
|
||||||
---
|
|
||||||
name: Epic
|
|
||||||
about: Agile Epic
|
|
||||||
title: ''
|
|
||||||
labels: epic
|
|
||||||
assignees: ''
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
*Description here*
|
|
||||||
|
|
||||||
## Stories
|
|
||||||
*Stories linked to this epic*
|
|
||||||
|
|
||||||
## Bugs
|
|
||||||
*Bugs linked to this epic*
|
|
20
.github/ISSUE_TEMPLATE/feature_request.md
vendored
20
.github/ISSUE_TEMPLATE/feature_request.md
vendored
|
@ -1,20 +0,0 @@
|
||||||
---
|
|
||||||
name: Feature request
|
|
||||||
about: Suggest an idea for this project
|
|
||||||
title: ''
|
|
||||||
labels: enhancement
|
|
||||||
assignees: ''
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
**Is your feature request related to a problem? Please describe.**
|
|
||||||
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
|
|
||||||
|
|
||||||
**Describe the solution you'd like**
|
|
||||||
A clear and concise description of what you want to happen.
|
|
||||||
|
|
||||||
**Describe alternatives you've considered**
|
|
||||||
A clear and concise description of any alternative solutions or features you've considered.
|
|
||||||
|
|
||||||
**Additional context**
|
|
||||||
Add any other context or screenshots about the feature request here.
|
|
24
.github/ISSUE_TEMPLATE/user-story.md
vendored
24
.github/ISSUE_TEMPLATE/user-story.md
vendored
|
@ -1,24 +0,0 @@
|
||||||
---
|
|
||||||
name: User Story
|
|
||||||
about: Agile User Story
|
|
||||||
title: ''
|
|
||||||
labels: needs criteria, story
|
|
||||||
assignees: ''
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
Epic Link: N/A
|
|
||||||
Story Points: N/A
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
*Description here*
|
|
||||||
|
|
||||||
## Acceptance Criteria
|
|
||||||
*Add your ACs here*
|
|
||||||
|
|
||||||
## Notes
|
|
||||||
*Any extra information*
|
|
||||||
|
|
||||||
## Subtasks
|
|
||||||
*Add technical subtasks here*
|
|
30
.github/pull_request_template.md
vendored
30
.github/pull_request_template.md
vendored
|
@ -1,30 +0,0 @@
|
||||||
# Description
|
|
||||||
|
|
||||||
Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.
|
|
||||||
|
|
||||||
Fixes # (issue)
|
|
||||||
|
|
||||||
## Type of change
|
|
||||||
|
|
||||||
Please delete options that are not relevant.
|
|
||||||
|
|
||||||
- [ ] Bug fix (non-breaking change which fixes an issue)
|
|
||||||
- [ ] New feature (non-breaking change which adds functionality)
|
|
||||||
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
|
|
||||||
- [ ] This change requires a documentation update
|
|
||||||
|
|
||||||
# How Has This Been Tested?
|
|
||||||
|
|
||||||
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
|
|
||||||
|
|
||||||
|
|
||||||
# Checklist:
|
|
||||||
|
|
||||||
- [ ] My code follows the style guidelines of this project
|
|
||||||
- [ ] I have performed a self-review of my own code
|
|
||||||
- [ ] I have commented my code, particularly in hard-to-understand areas
|
|
||||||
- [ ] I have made corresponding changes to the documentation
|
|
||||||
- [ ] My changes generate no new warnings
|
|
||||||
- [ ] I have added tests that prove my fix is effective or that my feature works
|
|
||||||
- [ ] New and existing unit tests pass locally with my changes
|
|
||||||
- [ ] Any dependent changes have been merged and published in downstream modules
|
|
|
@ -1,29 +0,0 @@
|
||||||
# Description
|
|
||||||
|
|
||||||
Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.
|
|
||||||
|
|
||||||
Fixes # (issue)
|
|
||||||
|
|
||||||
## Type of change
|
|
||||||
|
|
||||||
Please delete options that are not relevant.
|
|
||||||
|
|
||||||
- Bug fix (non-breaking change which fixes an issue)
|
|
||||||
- New feature (non-breaking change which adds functionality)
|
|
||||||
- Breaking change (fix or feature that would cause existing functionality to not work as expected)
|
|
||||||
- This change requires a documentation update
|
|
||||||
|
|
||||||
# How Has This Been Tested?
|
|
||||||
|
|
||||||
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
|
|
||||||
|
|
||||||
# Checklist
|
|
||||||
|
|
||||||
- [ ] My code follows the style guidelines of this project
|
|
||||||
- [ ] I have performed a self-review of my own code
|
|
||||||
- [ ] I have commented my code, particularly in hard-to-understand areas
|
|
||||||
- [ ] I have made corresponding changes to the documentation
|
|
||||||
- [ ] My changes generate no new warnings
|
|
||||||
- [ ] I have added tests that prove my fix is effective or that my feature works
|
|
||||||
- [ ] New and existing unit tests pass locally with my changes
|
|
||||||
- [ ] Any dependant changes have been merged and published in downstream modules
|
|
|
@ -7,7 +7,7 @@
|
||||||
# any secret values.
|
# any secret values.
|
||||||
|
|
||||||
BOT_TOKEN=
|
BOT_TOKEN=
|
||||||
BOT_VER=3.1
|
BOT_VER=3.1.1
|
||||||
BOT_AUTHOR=Vylpes
|
BOT_AUTHOR=Vylpes
|
||||||
BOT_OWNERID=147392775707426816
|
BOT_OWNERID=147392775707426816
|
||||||
BOT_CLIENTID=680083120896081954
|
BOT_CLIENTID=680083120896081954
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
# any secret values.
|
# any secret values.
|
||||||
|
|
||||||
BOT_TOKEN=
|
BOT_TOKEN=
|
||||||
BOT_VER=3.1
|
BOT_VER=3.1.1
|
||||||
BOT_AUTHOR=Vylpes
|
BOT_AUTHOR=Vylpes
|
||||||
BOT_OWNERID=147392775707426816
|
BOT_OWNERID=147392775707426816
|
||||||
BOT_CLIENTID=1016767908740857949
|
BOT_CLIENTID=1016767908740857949
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "vylbot-app",
|
"name": "vylbot-app",
|
||||||
"version": "3.1.0",
|
"version": "3.1.1",
|
||||||
"description": "A discord bot made for Vylpes' Den",
|
"description": "A discord bot made for Vylpes' Den",
|
||||||
"main": "./dist/vylbot",
|
"main": "./dist/vylbot",
|
||||||
"typings": "./dist",
|
"typings": "./dist",
|
||||||
|
@ -10,7 +10,8 @@
|
||||||
"start": "node ./dist/vylbot",
|
"start": "node ./dist/vylbot",
|
||||||
"test": "jest",
|
"test": "jest",
|
||||||
"db:up": "typeorm migration:run -d dist/database/dataSources/appDataSource.js",
|
"db:up": "typeorm migration:run -d dist/database/dataSources/appDataSource.js",
|
||||||
"db:down": "typeorm migration:revert -d dist/database/dataSources/appDataSource.js"
|
"db:down": "typeorm migration:revert -d dist/database/dataSources/appDataSource.js",
|
||||||
|
"release": "np --no-publish"
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
|
@ -39,8 +40,12 @@
|
||||||
"ts-jest": "^29.0.0",
|
"ts-jest": "^29.0.0",
|
||||||
"typeorm": "0.3.17"
|
"typeorm": "0.3.17"
|
||||||
},
|
},
|
||||||
|
"resolutions": {
|
||||||
|
"**/semver": "^7.5.2"
|
||||||
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/node": "^20.0.0",
|
"@types/node": "^20.0.0",
|
||||||
|
"np": "^8.0.4",
|
||||||
"typescript": "^5.0.0"
|
"typescript": "^5.0.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
91
src/commands/poll.ts
Normal file
91
src/commands/poll.ts
Normal file
|
@ -0,0 +1,91 @@
|
||||||
|
import { CommandInteraction, SlashCommandBuilder } from "discord.js";
|
||||||
|
import { Command } from "../type/command";
|
||||||
|
import { EmbedBuilder } from "@discordjs/builders";
|
||||||
|
import EmbedColours from "../constants/EmbedColours";
|
||||||
|
|
||||||
|
export default class Poll extends Command {
|
||||||
|
constructor() {
|
||||||
|
super();
|
||||||
|
|
||||||
|
super.CommandBuilder = new SlashCommandBuilder()
|
||||||
|
.setName('poll')
|
||||||
|
.setDescription('Run a poll, automatically adding reaction emojis as options')
|
||||||
|
.addStringOption(option =>
|
||||||
|
option
|
||||||
|
.setName('title')
|
||||||
|
.setDescription('Title of the poll')
|
||||||
|
.setRequired(true))
|
||||||
|
.addStringOption(option =>
|
||||||
|
option
|
||||||
|
.setName('option1')
|
||||||
|
.setDescription('Option 1')
|
||||||
|
.setRequired(true))
|
||||||
|
.addStringOption(option =>
|
||||||
|
option
|
||||||
|
.setName('option2')
|
||||||
|
.setDescription('Option 2')
|
||||||
|
.setRequired(true))
|
||||||
|
.addStringOption(option =>
|
||||||
|
option
|
||||||
|
.setName('option3')
|
||||||
|
.setDescription('Option 3'))
|
||||||
|
.addStringOption(option =>
|
||||||
|
option
|
||||||
|
.setName('option4')
|
||||||
|
.setDescription('Option 4'))
|
||||||
|
.addStringOption(option =>
|
||||||
|
option
|
||||||
|
.setName('option5')
|
||||||
|
.setDescription('Option 5'));
|
||||||
|
}
|
||||||
|
|
||||||
|
public override async execute(interaction: CommandInteraction) {
|
||||||
|
const title = interaction.options.get('title');
|
||||||
|
const option1 = interaction.options.get('option1');
|
||||||
|
const option2 = interaction.options.get('option2');
|
||||||
|
const option3 = interaction.options.get('option3');
|
||||||
|
const option4 = interaction.options.get('option4');
|
||||||
|
const option5 = interaction.options.get('option5');
|
||||||
|
|
||||||
|
if (!title || !option1 || !option2) return;
|
||||||
|
|
||||||
|
const description = [
|
||||||
|
option1.value as string,
|
||||||
|
option2.value as string,
|
||||||
|
option3?.value as string,
|
||||||
|
option4?.value as string,
|
||||||
|
option5?.value as string
|
||||||
|
]
|
||||||
|
.filter(x => x != null);
|
||||||
|
|
||||||
|
const arrayOfNumbers = [
|
||||||
|
':one:',
|
||||||
|
':two:',
|
||||||
|
':three:',
|
||||||
|
':four:',
|
||||||
|
':five:',
|
||||||
|
];
|
||||||
|
|
||||||
|
const reactionEmojis = ["1️⃣", "2️⃣", "3️⃣", "4️⃣", "5️⃣", "6️⃣", "7️⃣", "8️⃣", "9️⃣"];
|
||||||
|
|
||||||
|
description.forEach((value, index) => {
|
||||||
|
description[index] = `${reactionEmojis[index]} ${description[index]}`;
|
||||||
|
});
|
||||||
|
|
||||||
|
const embed = new EmbedBuilder()
|
||||||
|
.setColor(EmbedColours.Ok)
|
||||||
|
.setTitle(title.value as string)
|
||||||
|
.setDescription(description.join('\n'))
|
||||||
|
.setFooter({
|
||||||
|
text: `Poll by ${interaction.user.username}`,
|
||||||
|
iconURL: interaction.user.avatarURL()!,
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
const message = await interaction.reply({ embeds: [ embed ]});
|
||||||
|
|
||||||
|
description.forEach(async (value, index) => {
|
||||||
|
await (await message.fetch()).react(reactionEmojis[index]);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
|
@ -13,6 +13,7 @@ import Disable from "./commands/disable";
|
||||||
import Ignore from "./commands/ignore";
|
import Ignore from "./commands/ignore";
|
||||||
import Kick from "./commands/kick";
|
import Kick from "./commands/kick";
|
||||||
import Mute from "./commands/mute";
|
import Mute from "./commands/mute";
|
||||||
|
import Poll from "./commands/poll";
|
||||||
import Role from "./commands/Role/role";
|
import Role from "./commands/Role/role";
|
||||||
import ConfigRole from "./commands/Role/config";
|
import ConfigRole from "./commands/Role/config";
|
||||||
import Rules from "./commands/rules";
|
import Rules from "./commands/rules";
|
||||||
|
@ -49,6 +50,7 @@ export default class Registry {
|
||||||
CoreClient.RegisterCommand("ignore", new Ignore());
|
CoreClient.RegisterCommand("ignore", new Ignore());
|
||||||
CoreClient.RegisterCommand("kick", new Kick());
|
CoreClient.RegisterCommand("kick", new Kick());
|
||||||
CoreClient.RegisterCommand("mute", new Mute());
|
CoreClient.RegisterCommand("mute", new Mute());
|
||||||
|
CoreClient.RegisterCommand("poll", new Poll());
|
||||||
CoreClient.RegisterCommand("rules", new Rules());
|
CoreClient.RegisterCommand("rules", new Rules());
|
||||||
CoreClient.RegisterCommand("setup", new Setup());
|
CoreClient.RegisterCommand("setup", new Setup());
|
||||||
CoreClient.RegisterCommand("timeout", new Timeout());
|
CoreClient.RegisterCommand("timeout", new Timeout());
|
||||||
|
|
Loading…
Reference in a new issue