discord.py-rewrite

Discord.py user.block/user.send_friend_request: Error 403/Forbidden How do I give the bot permission to send friend requests and block users?

[亡魂溺海] 提交于 2021-02-11 12:50:12
问题 I'm currently trying to create a block user and send friend request command. However, I've hit a wall. It seems like the bot doesn't have permission or authorization to my account so it can't send friend requests or block users. How do I give it the permissions? Or maybe it isn't possible at all? Please let me know, I'd really appreciate it :> My current code for the commands is below: @client.command() async def unfriend(ctx, *, user: discord.User): await user.remove_friend() await ctx.send(

discord.py-rewrite Blacklist certain people from using the bot

梦想与她 提交于 2021-02-11 05:12:57
问题 I am making a bot similar to "Discord Deliver" and "Discord Byte" where people can order virtual food, and I want to be able to black list certain people from using the bot. Is there any way of doing this? For all my commands i use @bot.command ; I am specifying this as some people use on_message . Sorry that I don't have anything I've tried, I am relatively new to discord.py-rewrite. 回答1: You can make a set containing their names and exit the function if the command's author's name is in

discord.py-rewrite Blacklist certain people from using the bot

好久不见. 提交于 2021-02-11 05:10:29
问题 I am making a bot similar to "Discord Deliver" and "Discord Byte" where people can order virtual food, and I want to be able to black list certain people from using the bot. Is there any way of doing this? For all my commands i use @bot.command ; I am specifying this as some people use on_message . Sorry that I don't have anything I've tried, I am relatively new to discord.py-rewrite. 回答1: You can make a set containing their names and exit the function if the command's author's name is in

discord.py-rewrite Blacklist certain people from using the bot

。_饼干妹妹 提交于 2021-02-11 05:10:00
问题 I am making a bot similar to "Discord Deliver" and "Discord Byte" where people can order virtual food, and I want to be able to black list certain people from using the bot. Is there any way of doing this? For all my commands i use @bot.command ; I am specifying this as some people use on_message . Sorry that I don't have anything I've tried, I am relatively new to discord.py-rewrite. 回答1: You can make a set containing their names and exit the function if the command's author's name is in

Check reaction user not work for specific user?

风流意气都作罢 提交于 2021-02-11 04:55:28
问题 I'm trying to make the bot reaction only change for the specific user that do !pages command, I tried message.author and reaction.message.author == message.author but it didn't work! The issue is that when someone used this command, it will also worked for others which is not what I expected.. Here's the code from discord.ext import commands bot = commands.Bot(command_prefix='!') left = '⏪' right = '⏩' messages = ("1", "2", "3") def predicate(message, l, r): def check(reaction, user): if

How to loop with a reaction embed menu

你说的曾经没有我的故事 提交于 2021-02-10 15:43:18
问题 What I'm trying to do : Learning to make a proper help menu for my discord.py bot by having the ctx.message.author react to the message with the reactions given. The bot checks if they've been reacted to, then edits the message. If the ctx.message.author un-reacts, it goes back to the first menu (menuu). Problem(s) : I'm not sure how to loop through this until the timeout runs out. I'm also not sure how to check if the user un-reacts to the message. Error(s) : No errors. @client.command()

How to loop with a reaction embed menu

末鹿安然 提交于 2021-02-10 15:42:02
问题 What I'm trying to do : Learning to make a proper help menu for my discord.py bot by having the ctx.message.author react to the message with the reactions given. The bot checks if they've been reacted to, then edits the message. If the ctx.message.author un-reacts, it goes back to the first menu (menuu). Problem(s) : I'm not sure how to loop through this until the timeout runs out. I'm also not sure how to check if the user un-reacts to the message. Error(s) : No errors. @client.command()

How to make a bot join voice channels discord.py

怎甘沉沦 提交于 2021-02-09 10:58:09
问题 I'm using discord.py to create a music bot, but I'm having trouble connecting the bot to a voice channel. Im using a Cog to seperate the music features from the rest. @commands.command() async def join_voice(self, ctx): channel = ctx.author.voice.channel print(channel.id) await self.client.VoiceChannel.connect() But I get the error: AttributeError: 'NoneType' object has no attribute 'channel' I've looked all through the docs and all the similar questions on here and still no solutions! Could

How to make a bot join voice channels discord.py

可紊 提交于 2021-02-09 10:58:04
问题 I'm using discord.py to create a music bot, but I'm having trouble connecting the bot to a voice channel. Im using a Cog to seperate the music features from the rest. @commands.command() async def join_voice(self, ctx): channel = ctx.author.voice.channel print(channel.id) await self.client.VoiceChannel.connect() But I get the error: AttributeError: 'NoneType' object has no attribute 'channel' I've looked all through the docs and all the similar questions on here and still no solutions! Could

Discord.py-Rewrite Taking a list of blacklisted terms and checks if arguments after command contains one of the blacklisted terms

允我心安 提交于 2021-02-08 08:38:20
问题 MY GOAL I am working on a discord bot similar to "Discord Delivers" and "Pizza Byte". And I am trying to take a list of terms/keywords and check if the arguments after the command (The code for the command is at the end of this post); So if they do >order BadWord then it checks if it contains one of the previously specified blacklisted terms, and if so, does like await ctx.send("Due to your order containing one of the blacklisted terms, your order will not be placed.") Or something like that.