discord

Positional error when trying to specify member

我的梦境 提交于 2019-12-11 19:48:28
问题 Hi I'm trying to get a member name rather than the author name I've tried a few methods like for member is message.server.members: which returned multiple results with every member in the server and tried member: discord.Member as a signature which produced an error: Heres what I'm working with: async def on_message_delete(self, message): server = message.server author = message.author role = get(server.roles, name="Powerbot") channel = get(message.server.channels, name="mod-log") time =

Discord.js Arguments With Spaces

橙三吉。 提交于 2019-12-11 19:32:56
问题 So I'm trying to create my bot and I want there to be a command which adds information to a sqlite database https://gyazo.com/6961a05dc2d6aeca6683b59f888c2e82 if (command === "addplayer") { message.delete() let [name, crew, rank, weapon, df, talent, profession, other] = args; if(!name) return message.author.send("Name argument is required!"); let id = name.toLowerCase(); if(!crew) {let crew = "Blank";} if(!rank) {let rank = "Blank";} if(!weapon) {let weapon = "Blank";} if(!df) {let df =

Getting count of a specific reaction on a message

℡╲_俬逩灬. 提交于 2019-12-11 19:06:34
问题 I'm trying to make a bot that will delete messages with a certain amount of thumbsdown reactions. I'm having trouble identifying the count of a specific reaction on a message. Basically, I've created a command that waits for messages and adds them to my msgarray . After each message, I want to go through the array and delete any messages with the specified amount of reactions. This is what I have so far: var msgarray = []; const msgs = await message.channel.awaitMessages(msg => { msgarray

How to get a discord bot to output everything user inputs instead of just the first input?

不想你离开。 提交于 2019-12-11 18:55:54
问题 I'm trying to get a bot that will repeat what a user inputs, as many times as the user specifies. The issue I'm running into is that if the user types: !repeat 5 x y , the bot will only repeat x 5 times, and not x y 5 times. This is the code I'm trying to run: @bot.command() async def repeat(times: int, content="Repeating..."): for i in range(times): if times > 10: await bot.say("Cannot spam more than 10 messages at a time.") return else: await bot.say(content) 回答1: You can use the keyword

How to how to convert username to discord ID?

让人想犯罪 __ 提交于 2019-12-11 18:25:52
问题 I have a simple questions about discord. I am trying to create an economy system, and it works well, but I want to customize it a bit. I am using this person's module: https://github.com/Rapptz/discord.py How do I convert a username to a discord ID. For example if I have a discord "command" to allow people to gift each other money, like: james#0243 types !give 100 bob#9413 . How can I convert bob#9413 to a discord id like 58492482649273613 because in my database, I have people's users stored

How to stop discord bot respond to itself/all other bots [Discord Bot in Python 3.6]

爷,独闯天下 提交于 2019-12-11 18:19:41
问题 I am very new to programming and just learning. I figured making a discord bot is a good way to learn and I'm enjoying it, I'm just a little stuck. So my bot is private and there's a running joke in our discord server that whenever a user sends "k" all bots respond with "k". ATM we have Dyno, my friend's private bot and hopefully mine. I got all my code working except because the command and the answer is the same my bot just spams the server with "k" until I shut down the bot, how do I stop

Get message content from reply in DM

烂漫一生 提交于 2019-12-11 18:04:09
问题 I started making a little discord bot to give a key to people who request it. However, requirements changed and now I need to get a valid email from people who want one. I'm not sure how to get a reply in a DM. I saw Discord.py get message from DM But I don't really have client.get_user_info() or something? bot = commands.Bot(command_prefix='!') @bot.command(pass_context =True, no_pm=True, name='key', help="I give you a key. you're welcome", ) async def key_giver(ctx): commandTime = str

Private messaging a user

风格不统一 提交于 2019-12-11 18:01:44
问题 I am currently using the discord.js library and node.js to make a discord bot with one function - private messaging people. I would like it so that when a user says something like "/talkto @bob#2301" in a channel, the bot PMs @bob#2301 with a message. So what I would like to know is... how do I make the bot message a specific user (all I know currently is how to message the author of '/talkto'), and how do I make it so that the bot can find the user it needs to message within the command. (So

How do I move a user to a specific channel on discord using the discord.py API

混江龙づ霸主 提交于 2019-12-11 17:52:28
问题 Okay, so I know the command to do this but my issue is I do not know what arguments to pass to the parameters. I want my code to take a user's message content and then move the user to a voice channel named "afk". Here is a snippet of my code: All I want to do is move a user that types the words !move in any case to be moved to another voice channel. I am sorry if my code is bad but I just need this down. I know you might need to see my definitions but all it is: def on_message(message): if '

Why is message not defined in my Command?

ⅰ亾dé卋堺 提交于 2019-12-11 17:47:24
问题 So, I have made a help command with my discord bot and it looks much more neat when I send it as an embed message. However, it does take up a lot of space, so I was wondering if I could send it as a DM to the message.author . Here's what I have so far: import discord from discord.ext.commands import Bot from discord.ext import commands Client = discord.Client() bot_prefix = "." bot = commands.Bot(command_prefix=bot_prefix) @bot.event async def on_ready(): print("Bot Online!") print("Name: {}"