mirror of
https://github.com/System-End/Discord-Bot.git
synced 2026-04-19 16:28:26 +00:00
bug fix permissions name, giveawa announce channel
This commit is contained in:
parent
f79f13b457
commit
97464d25fc
3 changed files with 10 additions and 8 deletions
|
|
@ -45,8 +45,7 @@ module.exports = async (client) => {
|
|||
];
|
||||
}
|
||||
const randomText = statuttext[Math.floor(Math.random() * statuttext.length)];
|
||||
client.user.setActivity('activity', { type: Discord.ActivityType.Streaming });
|
||||
client.user.setPresence({ activities: [{ name: randomText }], status: 'online' });
|
||||
client.user.setPresence({ activities: [{ name: randomText, type: Discord.ActivityType.Playing }], status: 'online' });
|
||||
})
|
||||
}, 50000)
|
||||
|
||||
|
|
|
|||
|
|
@ -32,7 +32,11 @@ module.exports = async (client) => {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
// All bitfields to name
|
||||
client.bitfieldToName = function (bitfield) {
|
||||
const permissions = new Discord.PermissionsBitField(bitfield);
|
||||
return permissions.toArray();
|
||||
}
|
||||
client.checkBotPerms = async function ({
|
||||
flags: flags,
|
||||
perms: perms
|
||||
|
|
@ -40,7 +44,7 @@ module.exports = async (client) => {
|
|||
for (let i = 0; i < flags.length; i++) {
|
||||
if (!interaction.guild.members.me.permissions.has(flags[i])) {
|
||||
client.errNoPerms({
|
||||
perms: perms[i],
|
||||
perms: client.bitfieldToName(flags[i]) || flags[i],
|
||||
type: 'editreply'
|
||||
}, interaction);
|
||||
|
||||
|
|
@ -48,7 +52,6 @@ module.exports = async (client) => {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
client.checkUserPerms = async function ({
|
||||
flags: flags,
|
||||
perms: perms
|
||||
|
|
@ -56,7 +59,7 @@ module.exports = async (client) => {
|
|||
for (let i = 0; i < flags.length; i++) {
|
||||
if (!interaction.member.permissions.has(flags[i])) {
|
||||
client.errMissingPerms({
|
||||
perms: perms[i],
|
||||
perms: client.bitfieldToName(flags[i]) || flags[i],
|
||||
type: 'editreply'
|
||||
}, interaction);
|
||||
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ module.exports = {
|
|||
subcommand
|
||||
.setName('start')
|
||||
.setDescription('Start a giveaway')
|
||||
.addChannelOption(option => option.setName('channel').setDescription('Channel where the giveaway should be').setRequired(true).addChannelTypes(ChannelType.GuildText))
|
||||
.addChannelOption(option => option.setName('channel').setDescription('Channel where the giveaway should be').setRequired(true).addChannelTypes(ChannelType.GuildText, ChannelType.GuildAnnouncement))
|
||||
.addStringOption(option => option.setName('duration').setDescription('Duration of the giveaway').setRequired(true))
|
||||
.addNumberOption(option => option.setName('winners').setDescription('The number of giveaway winners').setRequired(true))
|
||||
.addStringOption(option => option.setName('prize').setDescription('The giveaway prize').setRequired(true)),
|
||||
|
|
@ -26,7 +26,7 @@ module.exports = {
|
|||
subcommand
|
||||
.setName('drop')
|
||||
.setDescription('Start a drop giveaway')
|
||||
.addChannelOption(option => option.setName('channel').setDescription('Channel where the giveaway should be').setRequired(true).addChannelTypes(ChannelType.GuildText))
|
||||
.addChannelOption(option => option.setName('channel').setDescription('Channel where the giveaway should be').setRequired(true).addChannelTypes(ChannelType.GuildText, ChannelType.GuildAnnouncement))
|
||||
.addStringOption(option => option.setName('duration').setDescription('Duration of the giveaway').setRequired(true))
|
||||
.addNumberOption(option => option.setName('winners').setDescription('The number of giveaway winners').setRequired(true))
|
||||
.addStringOption(option => option.setName('prize').setDescription('The giveaway prize').setRequired(true)),
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue