generated from mezotv/Discord-Bot-Template
-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add questions * Rather.js update * Add images and canvas command * Fix bug + language support * - Added debug command - Added translation fix - Added debugMode global function * Add more questions * Added text resize Co-Authored-By: MakeshiftJuliette <71993095+Cinnamonsroll@users.noreply.github.com> * Add custom strings * Update3 days (#59) * Dailymsgfix (#58) * Update replay.js * Create cooldown.js * Update en_EN.json * -votingCooldown * Daily MSG Fix * Revert "Merge remote-tracking branch 'origin/Cooldown-Functions'" This reverts commit e4de18c, reversing changes made to 756a0e9. * Remove channel.data --------- Co-authored-by: ForGetFulSkyBro <47897305+forgetfulskybro@users.noreply.github.com> Co-authored-by: Sean <sattler.junior@gmail.com> * - MISSING ** --------- Co-authored-by: ForGetFulSkyBro <47897305+forgetfulskybro@users.noreply.github.com> Co-authored-by: Sean <sattler.junior@gmail.com> * Add translations * Fix spanish translation * Update help.js * Fix debug string twist * Fixed debug check * Update webhookHandler.js * Adds testing debug * Add debug mode * Finish new rather command * Created settings.js * Fix settings command and translation * Fixed emojis * Adds never have I ever mode * Deleted translations for welcome and dailyMsgs * More settings (unfinished) * Fixed embed * Feat: emit command, user ping * Fix daily message * Fix ratelimit logs Co-Authored-By: Sean Sattler <sean@sattler.dev> * I hope? * Added it to .filter() should be better * Added it to .filter() should be better * Add more wwyd questions * Improve either.js * Resolve conflicts * Add either.js class * Add replay and vote cooldown * String + Either update * Update info.js * yeah... I'm sick of this * yeah... I'm sick of this * feat: dailymsg Interval * Added buttons to cooldown bypass * Change interval strings * remove await * Formatting Co-Authored-By: Marc Hoffmann <71778381+MarcWebDev@users.noreply.github.com> * Added additional categories * Removed old categories * Removed old categories * Finish dailymessage * No clue what I was doing here * Added dailyType * Deleted wytype * Added types and ids * Added toUpperCase * New language system * fix a blaring issue with mentions (#64) * Added not added translations but only at english bcs imagine I would translate them Finished vote end function Finished cron job Added shardReconnecting.js etc for better insights in console if something happen made it possible to load rather etc translations * Make full pie * Revert "Make full pie" This reverts commit 7edb5e8. * thread on dailymsg * Update discord and rest * Fix rest.post * Add thread support * Fix thread setting * Update dailymsg * Rework voting Co-Authored-By: DanPlayz <12685647+danplayz0@users.noreply.github.com> * Remove some old stuff Co-Authored-By: DanPlayz <12685647+danplayz0@users.noreply.github.com> * Linting * Clean up files * Work on voting * Finish update Co-Authored-By: Finn Kötting <69923589+finnkoetting@users.noreply.github.com> --------- Co-authored-by: Sean <sattler.junior@gmail.com> Co-authored-by: MakeshiftJuliette <71993095+Cinnamonsroll@users.noreply.github.com> Co-authored-by: ForGetFulSkyBro <47897305+forgetfulskybro@users.noreply.github.com> Co-authored-by: ForGetFulSkyBro <forgetfulskybro9@gmail.com> Co-authored-by: Sean Sattler <sean@sattler.dev> Co-authored-by: Marc Hoffmann <71778381+MarcWebDev@users.noreply.github.com> Co-authored-by: DanPlayz <damuffin36@gmail.com> Co-authored-by: DanPlayz <12685647+danplayz0@users.noreply.github.com> Co-authored-by: Finn Kötting <69923589+finnkoetting@users.noreply.github.com>
- Loading branch information
1 parent
d9d4309
commit 2008fc9
Showing
47 changed files
with
2,599 additions
and
964 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,131 @@ | ||
const { ButtonBuilder, ActionRowBuilder, EmbedBuilder } = require("discord.js"); | ||
const modalObject = { | ||
title: "Daily Messages Interval", | ||
custom_id: "dailyInterval", | ||
components: [ | ||
{ | ||
type: 1, | ||
components: [ | ||
{ | ||
type: 4, | ||
style: 1, | ||
custom_id: "input", | ||
label: "Enter a 24 hour dailymsg interval (HH:MM).", | ||
}, | ||
], | ||
}, | ||
], | ||
}; | ||
|
||
function isFormat(str) { | ||
return /^(?:[01]\d|2[0-3]):(?:00|30)$/.test(str); | ||
} | ||
|
||
module.exports = { | ||
data: { | ||
name: "dailyInterval", | ||
description: "Daily Interval customization", | ||
}, | ||
async execute(interaction, client, guildDb) { | ||
interaction.showModal(modalObject).catch(() => { }) | ||
interaction.awaitModalSubmit({ | ||
filter: (mInter) => mInter.customId === modalObject.custom_id, | ||
time: 60000, | ||
}) | ||
.then(async (modalInteraction) => { | ||
const value = modalInteraction.components[0].components[0].value; | ||
|
||
if (guildDb.dailyInterval === value) | ||
return modalInteraction.reply({ | ||
ephemeral: true, | ||
content: client.translation.get(guildDb?.language, 'Settings.intervalSame'), | ||
}); | ||
if (isFormat(value) === false) | ||
return modalInteraction.reply({ | ||
ephemeral: true, | ||
content: client.translation.get(guildDb?.language, 'Settings.intervalInvalid'), | ||
}); | ||
|
||
const dailyMsgs = new EmbedBuilder() | ||
.setTitle(client.translation.get(guildDb?.language, 'Settings.embed.dailyTitle')) | ||
.setDescription( | ||
`${client.translation.get(guildDb?.language, 'Settings.embed.dailyMsg')}: ${ | ||
guildDb.dailyMsg | ||
? `<:check:1077962440815411241>` | ||
: `<:x_:1077962443013238814>` | ||
}\n` + | ||
`${client.translation.get(guildDb?.language, 'Settings.embed.dailyChannel')}: ${ | ||
guildDb.dailyChannel | ||
? `<#${guildDb.dailyChannel}>` | ||
: `<:x_:1077962443013238814>` | ||
}\n` + | ||
`${client.translation.get(guildDb?.language, 'Settings.embed.dailyRole')}: ${ | ||
guildDb.dailyRole | ||
? `<@&${guildDb.dailyRole}>` | ||
: `<:x_:1077962443013238814>` | ||
}\n` + | ||
`${client.translation.get(guildDb?.language, 'Settings.embed.dailyTimezone')}: ${guildDb.dailyTimezone}\n` | ||
+ | ||
`${client.translation.get(guildDb?.language, 'Settings.embed.dailyInterval')}: ${value}\n` | ||
+ | ||
`${client.translation.get(guildDb?.language, 'Settings.embed.dailyType')}: ${guildDb.customTypes}\n`+ | ||
`${client.translation.get(guildDb?.language, 'Settings.embed.dailyThread')}: ${ | ||
guildDb.dailyThread | ||
? `<:check:1077962440815411241>` | ||
: `<:x_:1077962443013238814>` | ||
}` | ||
) | ||
.setColor("#0598F6") | ||
|
||
const dailyButtons = new ActionRowBuilder().addComponents( | ||
new ButtonBuilder() | ||
.setCustomId("dailyMsg") | ||
.setLabel(client.translation.get(guildDb?.language, 'Settings.button.dailyMsg')) | ||
.setStyle(guildDb.dailyMsg ? "Success" : "Secondary"), | ||
new ButtonBuilder() | ||
.setCustomId("dailyChannel") | ||
.setLabel(client.translation.get(guildDb?.language, 'Settings.button.dailyChannel')) | ||
.setStyle(guildDb.dailyChannel ? "Success" : "Secondary"), | ||
new ButtonBuilder() | ||
.setCustomId("dailyType") | ||
.setLabel(client.translation.get(guildDb?.language, 'Settings.button.dailyType')) | ||
.setStyle("Primary") | ||
.setEmoji("📝"), | ||
), | ||
dailyButtons2 = new ActionRowBuilder().addComponents( | ||
new ButtonBuilder() | ||
.setCustomId("dailyTimezone") | ||
.setLabel(client.translation.get(guildDb?.language, 'Settings.button.dailyTimezone')) | ||
.setStyle("Primary") | ||
.setEmoji("🌍"), | ||
new ButtonBuilder() | ||
.setCustomId("dailyRole") | ||
.setLabel(client.translation.get(guildDb?.language, 'Settings.button.dailyRole')) | ||
.setStyle(guildDb.dailyRole ? "Success" : "Secondary"), | ||
new ButtonBuilder() | ||
.setCustomId("dailyInterval") | ||
.setLabel(client.translation.get(guildDb?.language, 'Settings.button.dailyInterval')) | ||
.setStyle('Primary') | ||
.setEmoji("⏰"), | ||
), | ||
dailyButtons3 = new ActionRowBuilder().addComponents( | ||
new ButtonBuilder() | ||
.setCustomId("dailyThread") | ||
.setLabel(client.translation.get(guildDb?.language, 'Settings.button.dailyThread')) | ||
.setStyle(guildDb.dailyThread ? "Success" : "Secondary"), | ||
) | ||
|
||
|
||
await client.database.updateGuild(interaction.guild.id, { | ||
dailyInterval: value, | ||
}); | ||
|
||
return modalInteraction.update({ | ||
content: null, | ||
embeds: [dailyMsgs], | ||
components: [dailyButtons, dailyButtons2, dailyButtons3], | ||
ephemeral: true, | ||
}); | ||
}); | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
const { ButtonBuilder, ActionRowBuilder, EmbedBuilder } = require("discord.js"); | ||
module.exports = { | ||
data: { | ||
name: "dailyThread", | ||
description: "Daily Message Thread Toggle", | ||
}, | ||
async execute(interaction, client, guildDb) { | ||
const check = guildDb.dailyThread; | ||
const dailyThreads = new EmbedBuilder() | ||
.setTitle(client.translation.get(guildDb?.language, 'Settings.embed.dailyTitle')) | ||
.setDescription( | ||
`${client.translation.get(guildDb?.language, 'Settings.embed.dailyMsg')}: ${ | ||
guildDb.dailyMsg ? `<:check:1077962440815411241>` : `<:x_:1077962443013238814>` | ||
}\n${client.translation.get(guildDb?.language, 'Settings.embed.dailyChannel')}: ${ | ||
guildDb.dailyChannel | ||
? `<#${guildDb.dailyChannel}>` | ||
: `<:x_:1077962443013238814>` | ||
}\n${client.translation.get(guildDb?.language, 'Settings.embed.dailyRole')}: ${ | ||
guildDb.dailyRole | ||
? `<@&${guildDb.dailyRole}>` | ||
: `<:x_:1077962443013238814>` | ||
}\n${client.translation.get(guildDb?.language, 'Settings.embed.dailyTimezone')}: ${guildDb.dailyTimezone}\n${ | ||
client.translation.get(guildDb?.language, 'Settings.embed.dailyInterval') | ||
}: ${guildDb.dailyInterval}\n${client.translation.get(guildDb?.language, 'Settings.embed.dailyType')}: ${ | ||
guildDb.customTypes | ||
}\n`+ | ||
`${client.translation.get(guildDb?.language, 'Settings.embed.dailyThread')}: ${ | ||
check | ||
? `<:x_:1077962443013238814>` | ||
: `<:check:1077962440815411241>` | ||
}` | ||
) | ||
.setColor("#0598F6"); | ||
|
||
const dailyButtons = new ActionRowBuilder().addComponents( | ||
new ButtonBuilder() | ||
.setCustomId("dailyMsg") | ||
.setLabel(client.translation.get(guildDb?.language, 'Settings.button.dailyMsg')) | ||
.setStyle(guildDb.dailyMsg ? "Success" : "Secondary"), | ||
new ButtonBuilder() | ||
.setCustomId("dailyChannel") | ||
.setLabel(client.translation.get(guildDb?.language, 'Settings.button.dailyChannel')) | ||
.setStyle(guildDb.dailyChannel ? "Success" : "Secondary"), | ||
new ButtonBuilder() | ||
.setCustomId("dailyType") | ||
.setLabel(client.translation.get(guildDb?.language, 'Settings.button.dailyType')) | ||
.setStyle("Primary") | ||
.setEmoji("📝") | ||
), | ||
dailyButtons2 = new ActionRowBuilder().addComponents( | ||
new ButtonBuilder() | ||
.setCustomId("dailyTimezone") | ||
.setLabel(client.translation.get(guildDb?.language, 'Settings.button.dailyTimezone')) | ||
.setStyle("Primary") | ||
.setEmoji("🌍"), | ||
new ButtonBuilder() | ||
.setCustomId("dailyRole") | ||
.setLabel(client.translation.get(guildDb?.language, 'Settings.button.dailyRole')) | ||
.setStyle(guildDb.dailyRole ? "Success" : "Secondary"), | ||
new ButtonBuilder() | ||
.setCustomId("dailyInterval") | ||
.setLabel(client.translation.get(guildDb?.language, 'Settings.button.dailyInterval')) | ||
.setStyle("Primary") | ||
.setEmoji("⏰") | ||
), | ||
dailyButtons3 = new ActionRowBuilder().addComponents( | ||
new ButtonBuilder() | ||
.setCustomId("dailyThread") | ||
.setLabel(client.translation.get(guildDb?.language, 'Settings.button.dailyThread')) | ||
.setStyle(check ? "Secondary" : "Success"), | ||
) | ||
|
||
|
||
await client.database.updateGuild(interaction.guild.id, { | ||
dailyThread: check ? false : true, | ||
}); | ||
|
||
return interaction.update({ | ||
content: null, | ||
embeds: [dailyThreads], | ||
components: [dailyButtons, dailyButtons2, dailyButtons3], | ||
ephemeral: true, | ||
}); | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
const { ActionRowBuilder, StringSelectMenuBuilder } = require('discord.js'); | ||
module.exports = { | ||
data: { | ||
name: 'dailyType', | ||
description: 'Daily Type', | ||
}, | ||
async execute(interaction, client, guildDb) { | ||
const inter = new ActionRowBuilder() | ||
.addComponents( | ||
new StringSelectMenuBuilder() | ||
.setCustomId('selectMenuType') | ||
.setPlaceholder('Select a type') | ||
.addOptions([ | ||
{ | ||
label: 'Regular', | ||
value: 'regular', | ||
description: 'This changes it to use only default messages.', | ||
}, | ||
{ | ||
label: 'Mixed', | ||
value: 'mixed', | ||
description: 'This changes it to use both custom & default messages.', | ||
}, | ||
{ | ||
label: 'Custom', | ||
value: 'custom', | ||
description: 'This changes it to use only custom messages.', | ||
}, | ||
]) | ||
) | ||
|
||
interaction.update({ content: null, embeds: [], content: client.translation.get(guildDb?.language, 'Settings.dailyType'), components: [inter], ephemeral: true }) | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
const { EmbedBuilder, ActionRowBuilder, ButtonBuilder } = require('discord.js'); | ||
|
||
module.exports = { | ||
data: { | ||
name: 'neverhaveiever', | ||
description: 'never have i ever', | ||
}, | ||
async execute(interaction, client, guildDb) { | ||
const { Funny, Basic, Young, Food, RuleBreak } = await require(`../data/nhie-${guildDb.language}.json`); | ||
const neverArray = [...Funny, ...Basic, ...Young, ...Food, ...RuleBreak] | ||
const randomNever = Math.floor(Math.random() * neverArray.length) | ||
|
||
let ratherembed = new EmbedBuilder() | ||
.setColor("#0598F6") | ||
.setFooter({ text: `Requested by ${interaction.user.username} | Type: Random | ID: ${randomNever}`, iconURL: interaction.user.avatarURL() }) | ||
.setFooter({ | ||
text: `Requested by ${interaction.user.username} | Type: General | ID: ${randomNever}`, | ||
iconURL: interaction.user.avatarURL(), | ||
}) | ||
.setDescription(neverArray[randomNever]); | ||
|
||
const mainRow = new ActionRowBuilder(); | ||
if (Math.round(Math.random() * 15) < 3) { | ||
mainRow.addComponents([ | ||
new ButtonBuilder() | ||
.setLabel('Invite') | ||
.setStyle(5) | ||
.setEmoji('1009964111045607525') | ||
.setURL( | ||
'https://discord.com/oauth2/authorize?client_id=981649513427111957&permissions=275415247936&scope=bot%20applications.commands', | ||
) | ||
]); | ||
} | ||
mainRow.addComponents([ | ||
new ButtonBuilder() | ||
.setLabel('New Question') | ||
.setStyle(1) | ||
.setEmoji('1073954835533156402') | ||
.setCustomId(`neverhaveiever`) | ||
]); | ||
|
||
const time = guildDb?.voteCooldown ?? 60_000; | ||
const three_minutes = 3 * 60 * 1e3; | ||
|
||
|
||
const { | ||
row, | ||
id | ||
} = await client.voting.generateVoting(interaction.guildId, interaction.channelId, time < three_minutes ? 0 : ~~((Date.now() + time) / 1000), 1); | ||
|
||
return interaction.reply({ | ||
embeds: [ratherembed], | ||
components: [row, mainRow], | ||
}).catch((err) => { | ||
return console.log(err) | ||
}); | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
const { EmbedBuilder, ActionRowBuilder, ChannelType, ChannelSelectMenuBuilder } = require('discord.js'); | ||
module.exports = { | ||
data: { | ||
name: 'result', | ||
description: 'The voting result', | ||
}, | ||
async execute(interaction, client, guildDb) { | ||
const customId = interaction.customId.split('_'); | ||
|
||
const votingResults = await client.voting.getVotingResults(customId[1]) | ||
|
||
const resultEmbed = new EmbedBuilder() | ||
.setImage(votingResults.chart) | ||
|
||
interaction.reply({ | ||
embeds: [resultEmbed], | ||
ephemeral: true | ||
}) | ||
}, | ||
}; |
Oops, something went wrong.