discord

Discord Music bot VoiceClient' object has no attribute 'create_ytdl_player'

梦想的初衷 提交于 2020-08-19 10:44:11
问题 I wanted to programm my own discord bot, which plays some songs from youtube but it wont create the ydl player this is the error Command raised an exception: AttributeError: 'VoiceClient' object has no attribute 'create_ytdl_player' and this is my code. Thanks in advance. @client.command(pass_context=True) async def s(ctx): user=ctx.message.author voicech = ctx.author.voice.channel voice = await voicech.connect() player = await voice.create_ytdl_player("some url") player = await vc.create

Sending messages across channels with Discord.js, yields 'undefined' error

点点圈 提交于 2020-08-12 03:47:55
问题 I'm looking to create a 'say' command that allows me to directly message through the bot to a specific (or any, perhaps) channel. For beginner, and general testing purposes, my goal is to be able to use a standard if(commandIs("command", message) to directly message a channel in my test server, eventually evolving to all channels on a server. Through my research I've stumbled upon the: var channel = client.servers.get("name", "My Server").defaultChannel; client.sendMessage(channel, "Hello");

Sending messages across channels with Discord.js, yields 'undefined' error

旧时模样 提交于 2020-08-12 03:46:52
问题 I'm looking to create a 'say' command that allows me to directly message through the bot to a specific (or any, perhaps) channel. For beginner, and general testing purposes, my goal is to be able to use a standard if(commandIs("command", message) to directly message a channel in my test server, eventually evolving to all channels on a server. Through my research I've stumbled upon the: var channel = client.servers.get("name", "My Server").defaultChannel; client.sendMessage(channel, "Hello");

How to make the embed change when a user reacts on the message in discord.py rewrite?

£可爱£侵袭症+ 提交于 2020-08-10 20:23:26
问题 How do I make the embed description change when a user reacts with ▶ or ◀ ? This is the code I currently am using, - @client.command(aliases=['commands', 'info', 'cmds']) async def help(ctx): embed1 = discord.Embed(title=f"Everyone/Fun Commands-",description=f"```!vx userinfo [Member]```\n" f"**- Shows the info of the user mentioned.**\n\n" f"```!vx ping```\n" f"**- Shows the ping of the bot.**\n\n" f"```!vx help```\n" f"**- Shows a list of all commands.**\n\n" f"```!vx avatar [Member]```\n"

TypeError: message.guild.channels.forEach is not a function

本小妞迷上赌 提交于 2020-08-10 19:47:50
问题 I'm creating a mute command but when I want to disable speaking permission for the Mute role for each channel, I get this error: TypeError: message.guild.channels.forEach is not a function (The messages are in French) const Discord = require('discord.js'); const fs = require('fs'); const ms = require('ms'); module.exports.run = async(client, message, args) => { if(!message.guild.member(message.author).hasPermission("MUTE_MEMBERS")) return message.channel.send("❌ Vous n'avez pas la permission

How to use command name with spaces?

老子叫甜甜 提交于 2020-08-10 04:58:29
问题 How to make bot works when there is a space between commands in python bot. I know we can do that using sub-command or on_message but is there any another option to do that for only selected commands not for all commands. The following code will not work. @bot.command(pass_context=True) async def mobile phones(ctx): msg = "Pong. {0.author.mention}".format(ctx.message) await bot.say(msg) So I tried using alias but still it won't working. @bot.command(pass_context=True, aliases=['mobile phones'

Error loading discord bot on startup. hosted through repl.it

僤鯓⒐⒋嵵緔 提交于 2020-08-09 19:35:33
问题 A couple days ago my discord bot suddenly went offline, i host my bot through repl.it and i cant get it to work as it gives a dirty error. Traceback (most recent call last): File "main.py", line 584, in <module> bot.run("NTg0NjkyODA1NTcwNjU4MzEz.XPOnmw.VpE_ILHaDdQ6k--OIBRovc1h80o") File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/client.py", line 640, in run return future.result() File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/client.py", line 621, in

Error loading discord bot on startup. hosted through repl.it

不问归期 提交于 2020-08-09 19:31:06
问题 A couple days ago my discord bot suddenly went offline, i host my bot through repl.it and i cant get it to work as it gives a dirty error. Traceback (most recent call last): File "main.py", line 584, in <module> bot.run("NTg0NjkyODA1NTcwNjU4MzEz.XPOnmw.VpE_ILHaDdQ6k--OIBRovc1h80o") File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/client.py", line 640, in run return future.result() File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/client.py", line 621, in

With Discord.py, is there a way to read embedded messages?

瘦欲@ 提交于 2020-08-09 07:22:07
问题 My code print out the message the user sends. However, when an embedded message gets sent, there is nothing on the terminal and nothing is read. Is there a way for my bot to read embedded messages along with normal messages on discord Python 3.8 client = discord.Client() @client.event async def on_message(message): print(message.content) client.run(token) 回答1: You can get list of embeds from message with message.embeds . Link for docs. Try this solution: @client.event async def on_message

How to upload an image to Discord using Google Apps Script and a Discord Webhook?

爷,独闯天下 提交于 2020-08-08 10:13:35
问题 I've written the following script: function uploadImageToDiscord() { var link = "https://i.imgur.com/image.jpg"; var img = UrlFetchApp.fetch(link).getBlob(); var discordUrl = "https://discordapp.com/api/webhooks/mywebhook"; var payload = { "file": img }; var params = { headers: { "Content-Type": "multipart/form-data" }, method: "post", payload: payload, muteHttpExceptions: true }; var response = UrlFetchApp.fetch(discordUrl, params); Logger.log(response.getContentText()); } However, GAS tells