bots

Place the default help command of a Discord bot in a category (Python)

夙愿已清 提交于 2021-01-28 06:30:51
问题 When I used the default help command, it displayed all my commands categorically except for the help command which was under No Category . How do I add this to a cog? 回答1: This might not be the best solution, but you can remove the 'help' command, and re-add the 'help' command within your cog, since discord.py does not allow you to change a command's cog_name . The default help command is stored commands.bot._default_help_command . from discord.ext import commands bot = commands.Bot('.') bot

Discord.js V12 Rude words filter not working

自作多情 提交于 2021-01-28 03:41:44
问题 so I am adding like a rude words filter, whenever someone says that word (lowercase or uppercase) it deletes their message and replies back with something and then the reply gets deleted in a few seconds. Here's my current code, but it doesn't read the rudeWords and doesn't do anything when I write any of the rude words in the chat. client.on('message', message => { if (message.author.bot) return; let rudeWords = ["kys", "kill yourself"]; if (message.content.toLowerCase() === rudeWords) {

pick a random item from a javascript array

筅森魡賤 提交于 2021-01-27 15:05:18
问题 I am making a bot that can respond to my messages. If i send Hi! to the bot, it will answer With Well, hello there! . I was just wondering, what do I do to give the bot multiple choices of answers? Is there a way to pick a random item from a responses array using JavaScript? 回答1: Use Math.random * the length of the array, rounded down, as an index into the array. Like this: var answers = [ "Hey", "Howdy", "Hello There", "Wotcha", "Alright gov'nor" ] var randomAnswer = answers[Math.floor(Math

Update already posted Adaptive Card in Bot Framework v4 in C#

社会主义新天地 提交于 2021-01-27 06:30:50
问题 I'm working on a Bot with the Bot Framework v4 in C#. What I want now is, that after sending an Adaptive Card to the user, with Actions, that I can update this card after the Action is fired. For example, that the button will disappear after the click. Link to NodeJS Solution here I have a Solution in NodeJS, but I'm not able to transfer it to C#. Can anybody help? More Project details: I have an Adaptive Card that looks like this: This Card will be generated, after I searched with the MS

discord.js list all my bot commands

一个人想着一个人 提交于 2021-01-25 04:34:31
问题 i made a discord bot with discord.js and tried to do a help command to show the user all available commands. example command: avatar.js module.exports.run = async(bot, message, args) => { let msg = await message.channel.send("doing some magic ..."); let target = message.mentions.users.first() || message.author; await message.channel.send({files: [ { attachment: target.displayAvatarURL, name: "avatar.png" } ]}); msg.delete(); } module.exports.help = { name: "avatar", description: "show the

discord.js list all my bot commands

匆匆过客 提交于 2021-01-25 04:32:37
问题 i made a discord bot with discord.js and tried to do a help command to show the user all available commands. example command: avatar.js module.exports.run = async(bot, message, args) => { let msg = await message.channel.send("doing some magic ..."); let target = message.mentions.users.first() || message.author; await message.channel.send({files: [ { attachment: target.displayAvatarURL, name: "avatar.png" } ]}); msg.delete(); } module.exports.help = { name: "avatar", description: "show the

How to make a discord.js bot say custom messages in a specific channel & tag a user in a message

时光怂恿深爱的人放手 提交于 2021-01-25 04:07:49
问题 So, I wanted to create my own discord server for my friends and me, and I wanted it to have some bot features... So I got into coding.. long story short I messed it up and after hours of trying to find the solution I gave up. The first one is a word filter, works perfectly fine, I just cannot tag anyone.. It's supposed to delete the message that's said and give out a message, just like "@example, don't say that!" client.on('message', async(msg) => { if(msg.author.bot) return; if(!msg.guild)

Discord.js Bot Command that says a sentence from a random list of premade ones

╄→尐↘猪︶ㄣ 提交于 2021-01-07 02:57:00
问题 So basically, I'm trying to make a certain command for my bot, and I was going to see if any of you could help write something up. I want to make a command where a user types the command and then the bot will randomly choose from a list of prewritten sentences. I'm trying to make a fact command where when you do !fact it responds with a random fact. Note: This would be for my command handler. Thanks if any of you can help! 回答1: var facts = ["Your facts", "...", "..."]; var fact = Math.floor

Discord.js Bot Command that says a sentence from a random list of premade ones

会有一股神秘感。 提交于 2021-01-07 02:55:40
问题 So basically, I'm trying to make a certain command for my bot, and I was going to see if any of you could help write something up. I want to make a command where a user types the command and then the bot will randomly choose from a list of prewritten sentences. I'm trying to make a fact command where when you do !fact it responds with a random fact. Note: This would be for my command handler. Thanks if any of you can help! 回答1: var facts = ["Your facts", "...", "..."]; var fact = Math.floor

How to make a NSFW command in discord.py?

℡╲_俬逩灬. 提交于 2021-01-07 02:27:46
问题 I am making a discord bot and I want a NSFW command in, so I used a command that's puts a random image of a NSFW subreddit, but I need help with the detection of a NSFW channel, so this command can't be used in channels that are not nsfw, and also send a message that says "You need to use this command in a nsfw channel!" Here's my command, but there's a error in the part of "else:" async def nsfw(ctx): if ctx.channel.is_nsfw(): embed = discord.Embed(title="test", description="test") async