Compare commits

...

9 commits

Author SHA1 Message Date
RenovateBot 7f55b3d244 Update dependency minimatch to v9.0.3
Some checks failed
continuous-integration/drone/push Build is failing
continuous-integration/drone/pr Build is failing
2023-07-16 23:05:37 +00:00
Ethan Lane 02eff61a50 v3.1.1
Some checks failed
continuous-integration/drone/push Build is failing
2023-07-14 16:16:34 +01:00
Ethan Lane d2037543b0 Add np script
Some checks failed
continuous-integration/drone/push Build is failing
2023-07-14 16:14:18 +01:00
Ethan Lane 41c3fec23f Update .env to 3.1.1
Some checks failed
continuous-integration/drone/push Build is failing
2023-07-14 16:12:45 +01:00
Ethan Lane 3a38fbf7fc Remove .github folder
Some checks failed
continuous-integration/drone/push Build is failing
2023-07-14 16:11:31 +01:00
Ethan Lane 64649743e7 Add poll command 2023-07-14 16:10:39 +01:00
Ethan Lane 5a31c3cf74 Update semver to 7.5.2 2023-07-14 15:48:32 +01:00
Ethan Lane 00bd7d4ff5 Update random-bunny to 2.1.3 2023-07-14 15:46:09 +01:00
Vylpes c36b2fa7d8 Merge pull request 'v3.1.0' (#317) from develop into main
Some checks failed
continuous-integration/drone/push Build is failing
continuous-integration/drone/tag Build is failing
Reviewed-on: https://gitea.vylpes.xyz/RabbitLabs/vylbot-app/pulls/317
2023-07-08 13:30:22 +01:00
15 changed files with 2195 additions and 216 deletions

View file

@ -7,9 +7,8 @@
# any secret values.
BOT_TOKEN=
BOT_VER=3.1
BOT_VER=3.1.1
BOT_AUTHOR=Vylpes
BOT_DATE=08 May 2023
BOT_OWNERID=147392775707426816
BOT_CLIENTID=682942374040961060

View file

@ -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.

View file

@ -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*

View file

@ -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.

View file

@ -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*

View file

@ -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

View file

View file

@ -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

View file

@ -7,7 +7,7 @@
# any secret values.
BOT_TOKEN=
BOT_VER=3.1
BOT_VER=3.1.1
BOT_AUTHOR=Vylpes
BOT_OWNERID=147392775707426816
BOT_CLIENTID=680083120896081954

View file

@ -7,7 +7,7 @@
# any secret values.
BOT_TOKEN=
BOT_VER=3.1
BOT_VER=3.1.1
BOT_AUTHOR=Vylpes
BOT_OWNERID=147392775707426816
BOT_CLIENTID=1016767908740857949

View file

@ -1,6 +1,6 @@
{
"name": "vylbot-app",
"version": "3.1.0",
"version": "3.1.1",
"description": "A discord bot made for Vylpes' Den",
"main": "./dist/vylbot",
"typings": "./dist",
@ -10,7 +10,8 @@
"start": "node ./dist/vylbot",
"test": "jest",
"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": {
"type": "git",
@ -33,14 +34,18 @@
"emoji-regex": "^10.0.0",
"jest": "^29.0.0",
"jest-mock-extended": "^3.0.0",
"minimatch": "9.0.2",
"minimatch": "9.0.3",
"mysql": "^2.18.1",
"random-bunny": "^2.0.5",
"ts-jest": "^29.0.0",
"typeorm": "0.3.17"
},
"resolutions": {
"**/semver": "^7.5.2"
},
"devDependencies": {
"@types/node": "^20.0.0",
"np": "^8.0.4",
"typescript": "^5.0.0"
}
}

91
src/commands/poll.ts Normal file
View 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]);
});
}
}

View file

@ -13,6 +13,7 @@ import Disable from "./commands/disable";
import Ignore from "./commands/ignore";
import Kick from "./commands/kick";
import Mute from "./commands/mute";
import Poll from "./commands/poll";
import Role from "./commands/Role/role";
import ConfigRole from "./commands/Role/config";
import Rules from "./commands/rules";
@ -49,6 +50,7 @@ export default class Registry {
CoreClient.RegisterCommand("ignore", new Ignore());
CoreClient.RegisterCommand("kick", new Kick());
CoreClient.RegisterCommand("mute", new Mute());
CoreClient.RegisterCommand("poll", new Poll());
CoreClient.RegisterCommand("rules", new Rules());
CoreClient.RegisterCommand("setup", new Setup());
CoreClient.RegisterCommand("timeout", new Timeout());

2143
yarn.lock

File diff suppressed because it is too large Load diff