discord

AttributeError: module 'discord' has no attribute 'Embed'

非 Y 不嫁゛ 提交于 2019-12-25 11:05:31
问题 I have this code: embed=discord.Embed(title="Commands - Type '/help [command prefix]' for command info!", color=0xff0d13) embed.set_footer(text="!blacklist, !clean, !clear, !disconnect, !id, !joinserver, !listids, !np, !pause, !perms, !play, !pldump, !queue, !restart, !resume, !search, !setavatar, !setname, !setnick, !shuffle, !shutdown, !skip, !summon, !volume") await self.bot.say(embed=embed) and I keep getting this error: AttributeError: module 'discord' has no attribute 'Embed' But I don

Finding a user by Discord Discrim via Python

不羁的心 提交于 2019-12-25 09:33:46
问题 Once again, I'm into Discord bot coding. This time, I'm trying to make a way to find a user by it's Discrim. Getting the user by it's Discrim, would easly allow to do another things, like, find his ID, that by the meaning time, the profile picture, name... According to discord.py, we need to use get_user_info(user_id). But finding someone's ID can be hard for some, so if I could get the ID by the discrim and then do whatever, would be much easier. I tried do the following: DefaultUser =

How do I use client.send_file discord.py

霸气de小男生 提交于 2019-12-25 08:38:54
问题 @my_bot.command() async def memes(): await client.send_file(discord.Object(id='321332957690331138'),'1.jpg') I used that and I got error code 401 aka Unauthorized my_bot.run(TOKEN) I'm using that to login All my other commands work and do not output this error. -I'm quite new to this website so I may have done something wrong- 回答1: Your issue is that you need to pass a proper destination (channel in server) as the first parameter. To get the server object from a server ID you can use: server

Is there any way to have a discord bot join a server with accept_invite or anything like that?

风格不统一 提交于 2019-12-25 01:53:06
问题 Note: I'm using discord.py 0.16.12 I am wondering if there's any way to have a bot join a server within the code. Like there's a command that would be like: @client.command(pass_context=True) async def join(ctx, invite): client.join(invite) I've already tried @client.command() async def joinserver(mahlink): await client.accept_invite(mahlink) It dosen't work. This is the only thing I could find on google about this Also, running the accept_invite gives the following: discord.errors.Forbidden:

Delete certain message bot sends

*爱你&永不变心* 提交于 2019-12-24 23:19:10
问题 Have a scramble game that I want to delete the original message if it was solved or not solved. Tried client.delete_message(nameofmsghere) but it's not deleting it. if message.content.startswith('!scramble'): async with aiohttp.post("http://watchout4snakes.com/wo4snakes/Random/RandomWord") as post: assert isinstance(post, aiohttp.ClientResponse) word = await post.read() word = word.decode() print(word) scrambled = random.sample(word, len(word)) scrambled = ''.join(scrambled) scramblemsg =

Change Permissions Of A Channel Just Created

南笙酒味 提交于 2019-12-24 21:53:47
问题 I have the below code which is intended to create a new channel with a name. This works fine. It then needs to set the permissions of the channel to making it VIEW_CHANNEL false for all users. It then needs to overwrite permissions for the message author to grant them VIEW_CHANNEL. Im getting stuck on how to make the permissions apply on the channel just created. const Discord = require("discord.js"); module.exports.run = async (bot, message, args) => { let botIcon = bot.user.displayAvatarURL

I tried client.accept_invite() but It seems like discord doesn't allow that instead it says Guild Add Member should be used

半城伤御伤魂 提交于 2019-12-24 21:12:10
问题 I've tried client.accept_invite(), but discord API says that Guild Add Member should be used instead. I don't understand the concept in which Guild Add Member works, any help? How do I use the function same as accept_invite()? 回答1: You don't. Add Guild Member allows your bot, which has been added to a server, to give other people access to the server. The ability to accept invites through the API has been intentionally removed . I don't expect the ability to log into the API with a username

Discord Bot Embed Variables come back as undefined

大兔子大兔子 提交于 2019-12-24 20:52:20
问题 This is my code and the values keep being undefined https://cdn.discordapp.com/attachments/501784044649054231/509529437419732994/unknown.png This code is suppose to be !rebirth 1 1 1 and it should reply in embed Collective cash 1 Lifecoins 1 Tokens 1 exports.run = (_client, message, args) => { let {Cash} = args[0]; // Remember arrays are 0-based!. let {Tokens} = args[1]; let {LifeCoins} = args[2]; const Discord = require('discord.js') var embed = new Discord.RichEmbed() .setTitle("Rebirth")

Fetch bot messages from bots Discord.js

℡╲_俬逩灬. 提交于 2019-12-24 20:46:01
问题 I am trying to make a bot that fetches previous bot messages in the channel and then deletes them. I have this code currently that deletes all messages in the channel when !clearMessages is entered: if (message.channel.type == 'text') { message.channel.fetchMessages().then(messages => { message.channel.bulkDelete(messages); messagesDeleted = messages.array().length; // number of messages deleted // Logging the number of messages deleted on both the channel and console. message.channel.send(

Heroku on Discord Bot youtube_dl and discord[voice] error

吃可爱长大的小学妹 提交于 2019-12-24 18:48:23
问题 Bot Code : import discord import youtube_dl from discord.ext import commands client = commands.Bot(command_prefix = "e!") players = {} @client.event async def on_ready(): print("Bot çevrimiçi!") @client.command(pass_context = True) async def baglan(ctx): channel = ctx.message.author.voice.voice_channel await client.join_voice_channel(channel) @client.command(pass_context = True) async def oynat(ctx, url): server = ctx.message.server voice_client = client.voice_client_in(server) player = await