discord

Discord.js // Filtering message startsWith and work around DiscordAPIError for bulkDelete

感情迁移 提交于 2019-12-02 10:01:21
This is my current code. Credit goes to @André Dion for the help. if (message.channel.type == 'text') { message.channel.fetchMessages().then(messages => { const botMessages = messages.filter(msg => msg.author.bot) message.channel.bulkDelete(botMessages); messagesDeleted = botMessages.array().length; // number of messages deleted // Logging the number of messages deleted on both the channel and console message.channel.send("Deletion of messages successful. Total messages deleted: " + messagesDeleted); console.log('Deletion of messages successful. Total messages deleted: ' + messagesDeleted) })

on_reaction_add not being run

核能气质少年 提交于 2019-12-02 09:06:28
I'm new to discord.py and trying to make a translator bot. When the user reacts with a certain flag, the bot translates it, but the event is never getting called hence I have no code to translate any messages yet. I know it's not getting called because the program isn't printing an 'x' to the console. @client.event async def on_reaction_add(reaction, user): channel = reaction.message.channel print('x') await client.send_message(channel, '{} has added {} to the the message {}'.format(user.name, reaction.emoji, reaction.message.content)) await client.process_commands(reaction.message) There isn

Discord.NET - Bot immediately disconnects after joining voice channel

依然范特西╮ 提交于 2019-12-02 09:03:13
问题 I have all of the libraries (libopus.dll and libsodium.dll), I have FFMPEG and an audio file in my execution path, but still the bot immediately disconnects after joining the channel. Why is this happening and how do I fix it? EDIT: I use this sample for audio: https://gist.github.com/Joe4evr/773d3ce6cc10dbea6924d59bbfa3c62a 回答1: These are a few things I pulled from the official Discord API guild. Windows 64-bit: https://dsharpplus.emzi0767.com/natives/vnext_natives_win32_x64.zip Windows 32

MemoryError with Discord selfbot during 'bot.run'

陌路散爱 提交于 2019-12-02 08:57:30
问题 Before you tell me, yes I am aware that selfbots can get you banned. My selfbot is for work purposes in a server with me and three others. I'm doing nothing shady or weird over here. I'm using the following selfbot code: https://github.com/Supersebi3/Selfbot Upon logging in, being that I'm in about 50 servers, I experience the following: This carries on for several minutes, until I eventually get a MemoryError: File "main.py", line 96, in <module> bot.run(token, bot=False) File "D:\Python

Discord.py Invalid arguments inside member.server_default_channel

a 夏天 提交于 2019-12-02 08:55:16
My current code is @client.event async def on_member_join(member): serverchannel = member.server.default_channel msg = "Wuss poppin', {0}. Welcome to {1}".format(member.mention, member.server.name) await client.send_message(member.server.default_channel, msg)` @client.event async def on_member_remove(member): serverchannel = member.server.default_channel msg = "Well. Cya, {0}!".format(member.mention) await client.send_message(serverchannel, msg) As well as the other necessary lines (like import discord etc.) and other commands. When a member joins or leaves, I get this error: Ignoring

Can I check if there is a user in the voice channel?

橙三吉。 提交于 2019-12-02 08:51:00
问题 Turning the translator around can make English seem unnatural. If there are no users on the voice channel, the program will fail. So I would like to check if there are users on the voice channel and know the function of discord.py which does the bool or other reset type. elif message.content.startswith('>보이스'): tmp = str(message.author.display_name).split() tmp = tmp[2].split('(') if(len(tlst) >= 10 ): for i in range(0,len(lst)): if(tlst[4] == 3): print(i) vnum = tlst[i] vch = 'Duo_'+ str

How to get the username and Discord tag of the owner of server - Python

邮差的信 提交于 2019-12-02 08:40:51
I'm looking for a method in the discord.py library to return the owner of the server the bot has been deployed in. Right now I just have it hard coded (i.e. if message.content == '!owner': await message.channel.send('ownername#1234') ), but when the owner changes their name I have to change it, and it seems like a hassle for nothing. I've looked into the permissions system of discord.py but it doesn't seem to have something that does this. Is there anything that does this? You're looking for Guild.owner await message.channel.send(str(message.guild.owner)) 来源: https://stackoverflow.com

Discord bot running, but will not connect to server

╄→гoц情女王★ 提交于 2019-12-02 07:37:44
问题 I've been trying to swap over my code from the 0.9.6 Discord.NET API to the new 1.0.1 API, and it's basically calling for a complete restructure to my code. But I've been having some trouble actually getting the bot up and running first of all. I set up the code body according to the guide linked here And while it runs without error, the bot itself is not appearing online in my server. And before you ask, I had in fact replaced "Bot token here" with the actual bot token. namespace DiscordBot{

MemoryError with Discord selfbot during 'bot.run'

泄露秘密 提交于 2019-12-02 05:24:15
Before you tell me, yes I am aware that selfbots can get you banned. My selfbot is for work purposes in a server with me and three others. I'm doing nothing shady or weird over here. I'm using the following selfbot code: https://github.com/Supersebi3/Selfbot Upon logging in, being that I'm in about 50 servers, I experience the following: This carries on for several minutes, until I eventually get a MemoryError: File "main.py", line 96, in <module> bot.run(token, bot=False) File "D:\Python\Python36-32\lib\site-packages\discord\client.py", line 519, in run self.loop.run_until_complete(self.start

Discord.NET - Bot immediately disconnects after joining voice channel

岁酱吖の 提交于 2019-12-02 04:55:25
I have all of the libraries (libopus.dll and libsodium.dll), I have FFMPEG and an audio file in my execution path, but still the bot immediately disconnects after joining the channel. Why is this happening and how do I fix it? EDIT: I use this sample for audio: https://gist.github.com/Joe4evr/773d3ce6cc10dbea6924d59bbfa3c62a These are a few things I pulled from the official Discord API guild. Windows 64-bit: https://dsharpplus.emzi0767.com/natives/vnext_natives_win32_x64.zip Windows 32-bit: https://dsharpplus.emzi0767.com/natives/vnext_natives_win32_x86.zip FFmpeg for Windows: https:/