discord

Using discord.js to detect image and respond

落爺英雄遲暮 提交于 2021-02-05 07:42:23
问题 I'm trying to make a prank Discord bot for my friend's Discord server, but the bot won't respond to anything; not even the elseif function passes. If anyone know why my code isn't working can you please specify it. NOTE: Client variable is Discord.Client if you needed a reference. client.on("message", message => { if (message.channel.id != 425328056777834506) return; if (Math.floor(Math.random() * Math.floor(4))== 3 && message.embeds.length > 0) { message.channel.send("https://cdn.discordapp

NameError: 'discord' is not defined?

别说谁变了你拦得住时间么 提交于 2021-02-05 07:12:05
问题 This is for a discord bot I am making, and I have tried to set the bot's status. I've found an answer that looks like await bot.change_presence(activity=discord.Activity(type=discord.ActivityType.watching, name="for e/info")) and I have put it in an on_ready event function. However, it gives me the following exception: Ignoring exception in on_ready Traceback (most recent call last): File "C:\Users\user\AppData\Local\Programs\Python\Python38-32\lib\site-packages\discord\client.py", line 312,

Discord bot editing messages too slow

江枫思渺然 提交于 2021-02-04 20:50:51
问题 I want my discordbot to send send a message with an attached file in it and a text. Then the bot has to edit this text a couple of times but the problem is that when bot eddits message 5 times then it waits some time and then edits again 5 times etc etc. How can i make it edit messages without stopping? if(msg.content.includes("letter")){ msg.channel.send("alphabet", { files: ["/Users/48602/Videos/discordbot/aaa.png"]})} if(msg.content === 'alphabet'){ msg.edit("**a**") msg.edit("**b**") msg

Discord bot editing messages too slow

痞子三分冷 提交于 2021-02-04 20:50:26
问题 I want my discordbot to send send a message with an attached file in it and a text. Then the bot has to edit this text a couple of times but the problem is that when bot eddits message 5 times then it waits some time and then edits again 5 times etc etc. How can i make it edit messages without stopping? if(msg.content.includes("letter")){ msg.channel.send("alphabet", { files: ["/Users/48602/Videos/discordbot/aaa.png"]})} if(msg.content === 'alphabet'){ msg.edit("**a**") msg.edit("**b**") msg

Discord bot editing messages too slow

霸气de小男生 提交于 2021-02-04 20:49:56
问题 I want my discordbot to send send a message with an attached file in it and a text. Then the bot has to edit this text a couple of times but the problem is that when bot eddits message 5 times then it waits some time and then edits again 5 times etc etc. How can i make it edit messages without stopping? if(msg.content.includes("letter")){ msg.channel.send("alphabet", { files: ["/Users/48602/Videos/discordbot/aaa.png"]})} if(msg.content === 'alphabet'){ msg.edit("**a**") msg.edit("**b**") msg

Catching CommandOnCooldown Error

不羁岁月 提交于 2021-02-04 19:47:45
问题 I am making a discord bot that has a cooldown and I am attempting to make an event that when the CommandOnCooldown Error occurs, the bot will DM them how much longer they have to wait. Here is my code and it all looks okay, but it doesn't know what retry_after means: @bot.event async def on_CommandOnCooldown(): await bot.send_message(ctx.message.channel, 'You are on cooldown. Try again in {:.2f}s'.format(retry_after)) @bot.command(pass_context = True) @commands.cooldown(1, 30, commands

How to make a Discord Bot wait for a specific user to send a message with JDA?

你说的曾经没有我的故事 提交于 2021-02-02 09:30:59
问题 I'm currently taking an intro to programming class in Java, and have recently started experimenting with the JDA tools to make a basic Discord bot for my server. Ideally, I want my bot to respond when someone says "Hello Apples!" by asking them for their name, then responding with "Hi !" if this message was sent by the same person who said "Hello Apples!" Right now my bot fails to await any user input past the initial "Hello Apples!" message, and spills out all of its text at once. I believe

How to make a Discord Bot wait for a specific user to send a message with JDA?

牧云@^-^@ 提交于 2021-02-02 09:30:42
问题 I'm currently taking an intro to programming class in Java, and have recently started experimenting with the JDA tools to make a basic Discord bot for my server. Ideally, I want my bot to respond when someone says "Hello Apples!" by asking them for their name, then responding with "Hi !" if this message was sent by the same person who said "Hello Apples!" Right now my bot fails to await any user input past the initial "Hello Apples!" message, and spills out all of its text at once. I believe

How to make a Discord Bot wait for a specific user to send a message with JDA?

浪子不回头ぞ 提交于 2021-02-02 09:30:12
问题 I'm currently taking an intro to programming class in Java, and have recently started experimenting with the JDA tools to make a basic Discord bot for my server. Ideally, I want my bot to respond when someone says "Hello Apples!" by asking them for their name, then responding with "Hi !" if this message was sent by the same person who said "Hello Apples!" Right now my bot fails to await any user input past the initial "Hello Apples!" message, and spills out all of its text at once. I believe

Discord.js bot responds when mentioned

南楼画角 提交于 2021-02-01 05:14:57
问题 I'm trying to make my discord.js bot send a message when it is pinged. I was unsure how to do this so I referred to this code: client.on('message', message => { if (message.content === '<@745648345216712825>') { message.channel.send('Message Here'); } }); However, this doesn't work. Also, is it possible that my bot responds when a person mentions a specific user for example if I am mentioned by the user anywhere in a message the bot responds? If yes, can you show me how to do it? 回答1: Message