#discord-bots
1 messages · Page 750 of 1
property guild: Optional[Guild]```
The guild the interaction was sent from.
Oh it exists. Nvm
@commands.has_permissions(manage_messages=True)
async def snipe(ctx):
try:
contents, author, channel_name, time = bot.sniped_messages[ctx.guild.id]
except:
await ctx.channel.send("Didn't find anything to snipe!")
return
embed = discord.Embed(description=contents, color=discord.Color.purple(), timestamp=time)
embed.set_author(name=f"{author.name}#{author.discriminator}", icon_url=author.avatar_url)
embed.set_footer(text=f"Deleted in : #{channel_name}")
message = await ctx.channel.send(embed=embed)
await asyncio.sleep(2)
await message.delete()```
I need it to delete but it's not. I did asyncio.sleep(2) then delete but it isn't working
What are u trying to delete I cba to read it
If it's the embed at the end do
await ctx.send(embed=embed, delete_after=2)
i'll try
Yeah it worked thanks
No need for ctx.channel.send. ctx.send works fine
alright
Also, any reason you're not updated to discord.py 2.0?
hello person gazing at water
are there any free 24/7 hosting services, i only need this bot to work on 1 server
!e @bot.event
async def on_message_delete(message):
await message.channel.send(message.content)
@kind wasp :x: Your eval job has completed with return code 1.
001 | Traceback (most recent call last):
002 | File "<string>", line 1, in <module>
003 | NameError: name 'bot' is not defined
!e @client.event
async def on_message_delete(message):
await message.channel.send(message.content)
@kind wasp :x: Your eval job has completed with return code 1.
001 | Traceback (most recent call last):
002 | File "<string>", line 1, in <module>
003 | NameError: name 'client' is not defined
Its a closed environment
Try uptimerobot
thanks
Your Welcome 👍🏼 What does your bot do? @drifting swift
randomly replies to a message in my server with random stuff lol
Anything else? Hi = Hey, Wassup, Yo etc
maybe if i choose to expand on it
AttributeError: 'NoneType' object has no attribute 'id'
that is my error.
@client.command(aliases=['s'])
async def addRole(ctx, member : discord.Member=None,*,emoji=None):
author_id = ctx.author.id
if member == None:
await ctx.reply("I need a member for you to sign")
return
if emoji == None:
await ctx.reply("I need a team for you to sign the member too.")
return
newEmoji = emoji.split(":")
newEmoji2 = newEmoji[1]
roleName = newEmoji2.replace("_", " ")
role = discord.utils.get(member.guild.roles, name=(roleName))
role2 = discord.utils.get(member.guild.roles, name=(noRoleName))
await member.remove_roles(role2)
await member.add_roles(role)
can anybody help?
ooh like maybe a schedule thingy so it pings everyone when class starts
The author is None
That’s prob a 24 loop command 🤔
how can i fix that?
a hat
Is this rr?
no
Not sure
cuz it works on my other bots... exact same code
Do you have intents?
?
!intents
Using intents in discord.py
Intents are a feature of Discord that tells the gateway exactly which events to send your bot. By default, discord.py has all intents enabled, except for the Members and Presences intents, which are needed for events such as on_member and to get members' statuses.
To enable one of these intents, you need to first go to the Discord developer portal, then to the bot page of your bot's application. Scroll down to the Privileged Gateway Intents section, then enable the intents that you need.
Next, in your bot you need to set the intents you want to connect with in the bot's constructor using the intents keyword argument, like this:
from discord import Intents
from discord.ext import commands
intents = Intents.default()
intents.members = True
bot = commands.Bot(command_prefix="!", intents=intents)
For more info about using intents, see the discord.py docs on intents, and for general information about them, see the Discord developer documentation on intents.
i dont
Enable them, see what happens
ok
NameError: name 'intents' is not defined
from discord import Intents
PREFIX = "<"
client = commands.Bot(command_prefix=commands.when_mentioned_or(PREFIX), help_command=None, intents=intents)
What is it then? 🤔
from discord import Intents
from discord.ext import commands
intents = Intents.default()
intents.members = True
bot = commands.Bot(command_prefix="!", intents=intents)
Do you see your issue?
a command, lets users do
!addRole 👮♂️
than they will get a police man role
nope
Read lines 3 and 4
i still get the original error though
Did you enable them in the dev portal?
whats the dev portal?
oh
uhh no.. lemme go enable them
still same error
What you sent was all your code, correct?
all my code for the command, yes.
I got no clue then
Actually
Send your constructor again
I want to verify you did it correctly
constructor?
PREFIX = "<"
client = commands.Bot(command_prefix=commands.when_mentioned_or(PREFIX), help_command=None, intents=intents)```
Where do I verify my bot
For Admin, to assign?
Show me intents
Where you created your bot?
well yes. the command should let admins do
<addRole @amber beacon 👮♂️
i noticed
from discord import Intents
intents = Intents.default()
intents.members = True
PREFIX = "<"
client = commands.Bot(command_prefix=commands.when_mentioned_or(PREFIX), help_command=None, intents=intents)
No idea then
What you mean?
Does someone know to properly invite the bot
How do I make a guild into a guildchannel
Discord Dev hub
URL generator
Redirect uri
Invite
By
Using link
Alright, let me check. I have an invite but the bot doesn't have its own role when it joins
You could of put, all this in 1 sentence 🤣
I feel like it's my fault
Sometimes bots do that lol
That doesn't feel correct
Well in the URL generator
Select bot
And then
Select admin or other perms
Help?
Prob send, embed, view channels & read history instead of admin. 🤔
WELL THATS WHAT I SAID IF YOU CTX IS DEFINED
EVERYONE FORGETS TO DEFINE CTX
🙈




You Win 🤣🤣
Thanks guys. I read an article on it but I guess It wasn't good
What was your question? 🤔
Define ctx for once
@Bot.command(ctx): something like this?
No
What then?
Which bot?
@client.command()
async def idk(ctx)```
I was nearly right 🤣
i need help on why this isn't working i get no errors
@tasks.loop(seconds=10)
async def update_stats():
guild = client.get_guild(913793214505447505)
member_channel = client.get_channel(931624220885155860)
list_member = guild.members
#Edit stats All Member
mem = 'Members: ' + str(len(list_member))
print(mem)
await member_channel.edit(name=mem)
btw i am starting the task
Print guild and member_channel
1 sec
What’s it do?
They are not None
It's a member counter
I’ve got a working one of them, if you want it 👍🏼
I'll try myself but ty
👍🏼
And its returning all the members, correct?
Hey! I have a question if anyone knows some bots I could use for my idea?
I'd like for members of my server to be able to take a quiz with some questions and depending on their results be assigned a role
Not sure if it's entirely the right place to ask but couldn't find any better channel and hope that's okay!
okay first you'd the quiz questions. Do you have prior experience with dpy/python?
Making API calls on the on_ready event isn't a good idea.
If you want the status to be changed, when defining your bot instance ( bot=commands.Bot...), there is a kwarg for status/activity.
Example:
bot = commands.Bot(command_prefix="a prefix", activity=..., status=...)
Not really much to be honest just a little with Python but none with dpy, was just thinking if you possibly knew of existing bots/plugins for this issue. But I don't mind reading up on it and learning if it's not a too complicated of a project to do without prior knowledge
U could try making said bot
Tbh it isn't that hard, but you do need to know the basics of python
I'm not too sure about how complicated fetching data and such is, but I do have an external website where the survey can be done, would it be possible of some kind of bot checking the results over there and then have an if condition for the results like if it's greater than or equal to 80% they get assigned a role?
I'm trying to make a ban command interactive with buttons.
here is the traceback error im getting:
Traceback (most recent call last):
File "C:\Users\santi\AppData\Roaming\Python\Python310\site-packages\discord\ext\commands\bot.py", line 994, in invoke
await ctx.command.invoke(ctx)
File "C:\Users\santi\AppData\Roaming\Python\Python310\site-packages\discord\ext\commands\core.py", line 894, in invoke
await injected(*ctx.args, **ctx.kwargs)
File "C:\Users\santi\AppData\Roaming\Python\Python310\site-packages\discord\ext\commands\core.py", line 176, in wrapped
raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: AttributeError: 'str' object has no attribute 'author'
here is the code:
class Ban(discord.ui.View):
def __init__(self, ctx, member: discord.Member):
super().__init__()
self.value = None
@discord.ui.button(label='Ban', style=discord.ButtonStyle.red, emoji="⚒️")
async def create(self, button: discord.ui.Button, interaction: discord.Interaction):
await interaction.member.ban(reason=None) #give the user the role with the name 'verified'
await interaction.response.send_message(content=f"{interaction.user.name}{interaction.user.discriminator} has been banned!", ephemeral=True) # response message
self.value = False
@bot.command()
async def ban(self, ctx, user:discord.Member=None):
view = Ban
if user==None:
user=ctx.author
rlist = []
for role in user.roles:
if role.name != "@everyone":
rlist.append(role.mention)
b = ", ".join(rlist)
banembed = discord.Embed(title = f'User Info - {user}', colour=botcolortheme,timestamp=ctx.message.created_at)
banembed.set_author(name=f"You have initiated a `ban` on the following user:"),
banembed.set_thumbnail(url=user.avatar.url),
banembed.set_footer(text=f'Requested by - {ctx.author}', icon_url=ctx.author.avatar.url)
banembed.add_field(name='ID:',value=user.id,inline=False)
banembed.add_field(name='Name:',value=user.display_name,inline=False)
banembed.add_field(name='Created at:',value=user.created_at,inline=False)
banembed.add_field(name='Joined at:',value=user.joined_at,inline=False)
banembed.add_field(name='Bot?',value=user.bot,inline=False)
await ctx.send(embed=banembed, view=view)
await view.wait()
is python still good for bot making?
yeah sure, I asked that to know how detailed I should be in how to create it
So first, you'd need the quiz questions, and the answers
After that, you can send the questions using await ctx.send(the_question)
Then, you'd be using a await bot.wait_for for the bot to receive the user's answer.
Then you can check if the answer is equal to the question answer. If yes, you give a role.
So basically this is a rough idea
#create the quiz questions and answers as a variable. Let's take it as "quiz_questions" in this case, and the answer is "answer".
@bot.command()
async def quiz(ctx):
choice = random.choice(quiz_questions) #selecting a random question
await ctx.send(choice)
def check(message):
return message.author == ctx.author and message.channel == ctx.channel
msg = await bot.wait_for('message', check=check)
if msg.content == answer: #the answer is right
await ctx.send("You got it right!")
await msg.author.add_roles(the role you want) #adding the role to the user
else:
await ctx.send("You got it wrong") #they got the question wrong
Although mind the indents, they may be wrong
Yes. There are still good libraries to use.
An example being disnake.
what library do i use?
Thank you so much for taking your time into this response. Unfortunately a bit busy now but will check it out and also google a bit to get a better understanding and come back with any further questions I may have.
disnake is the most widely used.
import disnake
yes
like that?
Just like how you installed discord.py
all i did is py import discord and it installed
yeah no worries.
Here are the documentations since you mentioned you wouldn't mind reading through them, for each major part (just giving the commands, you can use them in #bot-commands)
Sending a message - !d discord.abc.Messageable.send
To get a random choice from a sequence - !d random.choice
Waiting for the user's message - !d discord.ext.commands.Bot.wait_for
Adding a role to a member - !d discord.Member.add_roles
Is this the full traceback?
Do you know which line the error is being raised from
no, doesn't say
hi again
is there a cmd for
{delete new message}```
No there is none, you need to store old messages yourself.
where do i start with this?
Anyone know any library that has support for membership screening/rules screening that is also compatible with d.py 1.7 Never mind I finally found the member.pending which seems to be what I'm looking for
has something changed with playing music using discord bots, music doesnt want to play?
Don’t think so but be careful with music bots especially if they use YouTube API
if self.guild.owner_id == obj.id:
dont tell me you cant check bot perms
or owner perms
ooo
Hey @twin moon!
It looks like you tried to attach a Python file - please use a code-pasting service such as https://paste.pythondiscord.com
its playing an mp3 of my own voice, saying "ahhhhhhhhhhhhhh" does that still go against tos?
not all all
however due to my own skepticism on how someone would use such knowledge i refrain from helping
i understand
could you possible just possibly, explain why when running the bot on a raspberry pi and playing sound, it works, yet when on windows proceeds not to?
#help-donut If anyone can help much appreciated.
SO
so, im trying to upload one of my bots to repl. I'm getting this error.
those are the packages i've installed
I dont think im missing any though
Per Python Discord's Rule 5, we are unable to assist with questions related to youtube-dl, pytube, or other YouTube video downloaders, as their usage violates YouTube's Terms of Service.
For reference, this usage is covered by the following clauses in YouTube's TOS, as of 2021-03-17:
The following restrictions apply to your use of the Service. You are not allowed to:
1. access, reproduce, download, distribute, transmit, broadcast, display, sell, license, alter, modify or otherwise use any part of the Service or any Content except: (a) as specifically permitted by the Service; (b) with prior written permission from YouTube and, if applicable, the respective rights holders; or (c) as permitted by applicable law;
3. access the Service using any automated means (such as robots, botnets or scrapers) except: (a) in the case of public search engines, in accordance with YouTube’s robots.txt file; (b) with YouTube’s prior written permission; or (c) as permitted by applicable law;
9. use the Service to view or listen to Content other than for personal, non-commercial use (for example, you may not publicly screen videos or stream music from the Service)
indentation looks fine to me
import music is a youtube downloader, we don't help with that here.
We won't help break ToS
can someone help me with my error?
discord.ui is only available in a certain branch of dpy
i.e master branch
then how do i install the correct one?
and replit uses pypoetry.. I think
discord.ui is from 2.0
you can just add the git repository to the pyproject.toml file
but ive already tried that
show me how you did it
i just put the link in there
you did it wrong then
also, i cant find the link
"discord.py" = { git = "https://github.com/Rapptz/discord.py.git", branch = "master" }
put this below [tool.poetry.dependencies]
and ensure you remove any other versions
on the pyproject.toml file btw
then you should be able to just run the project and it'll update
otherwise click the shell tab in replit and
use the
poetry update command
"discord.py" = { git = "https://github.com/Rapptz/discord.py.git", branch = "master" }
[tool.poetry.dependencies]
like this?
i said below
also there already should be an existing tool.poetry.dependencies
do not add a new section, put it below the existing one
ok
Can you directly add to a poetry toml file like you can in rust cargo.toml’s
I would assume so
and always consult documentation before asking for help
Then we'd have no people to help anymore
well the documentation doesn't always answer everything
still the person might save themselves so much trouble by reading it
Activate windows
why
hello. I have a question, how can I detect the message of a bot with the client
!d discord.on_message
discord.on_message(message)```
Called when a [`Message`](https://discordpy.readthedocs.io/en/master/api.html#discord.Message "discord.Message") is created and sent.
This requires [`Intents.messages`](https://discordpy.readthedocs.io/en/master/api.html#discord.Intents.messages "discord.Intents.messages") to be enabled.
Warning
Your bot’s own messages and private messages are sent through this event. This can lead cases of ‘recursion’ depending on how your bot was programmed. If you want the bot to not reply to itself, consider checking the user IDs. Note that [`Bot`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.Bot "discord.ext.commands.Bot") does not have this problem.
Traceback (most recent call last):
File "/home/container/.local/lib/python3.8/site-packages/discord/ext/commands/core.py", line 85, in wrapped
ret = await coro(*args, **kwargs)
File "bot.py", line 311, in avatar
userAvatarUrl = avamember.avatar_url
AttributeError: 'NoneType' object has no attribute 'avatar_url'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/home/container/.local/lib/python3.8/site-packages/discord/ext/commands/bot.py", line 939, in invoke
await ctx.command.invoke(ctx)
File "/home/container/.local/lib/python3.8/site-packages/discord/ext/commands/core.py", line 863, in invoke
await injected(*ctx.args, **ctx.kwargs)
File "/home/container/.local/lib/python3.8/site-packages/discord/ext/commands/core.py", line 94, in wrapped
raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: AttributeError: 'NoneType' object has no attribute 'avatar_url'```
i just runed my bot and tryied to use avatar command
wait the command works but when i type +avatar @nick
??
He means use something like this
@bot.event
async def on_message(message):
<whatever you want it to do>
await bot.process_commands(message)
sorry if it doesn’t look right
on mobile
Thx men
or just listen()
which imo is better
yeah
lol
I need it for a few simple on message reactions
but my testmode thingy I’m working on makes it pain
then use buttons lol
buttons?
wdym by buttons
!d disnake.ui.Button
class disnake.ui.Button(*, style=<ButtonStyle.secondary: 2>, label=None, disabled=False, custom_id=None, url=None, emoji=None, row=None)```
Represents a UI button.
New in version 2.0.
!d disnake.ui.View
class disnake.ui.View(*, timeout=180.0)```
Represents a UI view.
This object must be inherited to create a UI within Discord.
New in version 2.0.
for buttons you would need to subclass view
im not sure what fork or if your using dpy
main branch of dpy has view tho
!d discord.ui.View
class discord.ui.View(*, timeout=180.0)```
Represents a UI view.
This object must be inherited to create a UI within Discord.
New in version 2.0.
The thing is that I don’t need buttons
ic whats the command for?
Basically putting the bot in a toggle-able state that only I can use commands in
just check the interaction author
already doing that
with interaction_check
i see
but my problem rn is specifically that what I have currently is blocking all commands as if process_commands isn’t there
but it’s not referencing process commands at all
make sure your process commands isn't in an if statement
so whatever @ andy provided me with yesterday is breaking something upstream
it’s not
Pasting large amounts of code
If your code is too long to fit in a codeblock in discord, you can paste your code here:
https://paste.pythondiscord.com/
After pasting your code, save it by clicking the floppy disk icon in the top right, or by typing ctrl + S. After doing that, the URL should change. Copy the URL and post it here so others can see it.
It’s in its own bot.event
simple help and another with is_owner() to check
also not currently able to send the code
can't help then unfortunately
last option I can tell you on top of my head: disable the error handlers and the errors will start popping up by themselves
Basically I’d get an error saying that the command didn’t exist or something of the sort
can someone give any ideas what commands I can add to the bot because I have no ideas.
Traceback (most recent call last):
File "main.py", line 239, in <module>
client.run(os.getenv('TOKEN'))
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/client.py", line 663, in run
return future.result()
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/client.py", line 642, in runner
await self.start(*args, **kwargs)
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/client.py", line 605, in start
await self.login(token)
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/client.py", line 473, in login
data = await self.http.static_login(token.strip())
AttributeError: 'NoneType' object has no attribute 'strip'
so that is my error message...
[tool.poetry]
name = "npfl-bot"
version = "0.1.0"
description = ""
authors = ["Your Name <you@example.com>"]
[tool.poetry.dependencies]
python = "^3.8"
"discord.py" = { git = "https://github.com/Rapptz/discord.py.git", branch = "master" }
python-dotenv = "^0.19.2"
Flask = "^2.0.2"
[tool.poetry.dev-dependencies]
[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"
that is what is in my pyproject.toml. Btw this is in repl
hey there! If you're looking for ideas in relation to bot commands you should look into some popular apis such as the cat api, the reddit api or even the spotify API. They can really help to smark imagination!
hey! It seems as if you're not properly loading your .env file. I haven't used repl however this guide may help in relation to loading it correctly c: https://towardsdatascience.com/using-dotenv-to-hide-sensitive-information-in-python-77ab9dfdaac8?gi=196befa37be1
oop forgot to ping @frank tartan sorry
repl doesnt use .env files
but speaking of which, i never put the token in
Not sure what you mean, all you need to do is create the .env file in the main directory then tell python to load it.
yeah thats not how repl works...
not right
his token isnt correct thats all

all i did is forget to add the token ;/
lol
hey! Apologies for my lack of mention as that could be the case aswell. c:
no problem
how can i make it so I can do
-removeRoles {roleName}
and it will remove that role from everyone
something like
for member in ctx.guild.members:
...
for member in ctx.guild.members:
role = discord.utils.get(member.guild.roles, name=(roleName))
await ctx.member.remove_roles(role)
so this?
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: IndexError: list index out of range
i get that error
just member its a for loop
!e
numberlist = [1, 2, 3, 4, 5]
for number in numberlist:
print(number)
@slate swan :white_check_mark: Your eval job has completed with return code 0.
001 | 1
002 | 2
003 | 3
004 | 4
005 | 5
im confused still
How can I check if name_of_Role is None with utils.get?
I'm trying to make a ban command interactive with buttons.
here is the traceback error im getting:
Traceback (most recent call last):
File "C:\Users\santi\AppData\Roaming\Python\Python310\site-packages\discord\ext\commands\bot.py", line 994, in invoke
await ctx.command.invoke(ctx)
File "C:\Users\santi\AppData\Roaming\Python\Python310\site-packages\discord\ext\commands\core.py", line 894, in invoke
await injected(*ctx.args, **ctx.kwargs)
File "C:\Users\santi\AppData\Roaming\Python\Python310\site-packages\discord\ext\commands\core.py", line 176, in wrapped
raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: AttributeError: 'str' object has no attribute 'author'
here is the code:
class Ban(discord.ui.View):
def __init__(self, ctx, member: discord.Member):
super().__init__()
self.value = None
@discord.ui.button(label='Ban', style=discord.ButtonStyle.red, emoji="⚒️")
async def create(self, button: discord.ui.Button, interaction: discord.Interaction):
await interaction.member.ban(reason=None) #give the user the role with the name 'verified'
await interaction.response.send_message(content=f"{interaction.user.name}{interaction.user.discriminator} has been banned!", ephemeral=True) # response message
self.value = False
@bot.command()
async def ban(self, ctx, user:discord.Member=None):
view = Ban
if user==None:
user=ctx.author
rlist = []
for role in user.roles:
if role.name != "@everyone":
rlist.append(role.mention)
b = ", ".join(rlist)
banembed = discord.Embed(title = f'User Info - {user}', colour=botcolortheme,timestamp=ctx.message.created_at)
banembed.set_author(name=f"You have initiated a `ban` on the following user:"),
banembed.set_thumbnail(url=user.avatar.url),
banembed.set_footer(text=f'Requested by - {ctx.author}', icon_url=ctx.author.avatar.url)
banembed.add_field(name='ID:',value=user.id,inline=False)
banembed.add_field(name='Name:',value=user.display_name,inline=False)
banembed.add_field(name='Created at:',value=user.created_at,inline=False)
banembed.add_field(name='Joined at:',value=user.joined_at,inline=False)
banembed.add_field(name='Bot?',value=user.bot,inline=False)
await ctx.send(embed=banembed, view=view)
await view.wait()
no need for interaction
just
await member.ban
then why isnt it working???
await ctx.member.remove_roles(role) remove ctx
kk
it just doesnt remove any roles
!d discord.Member.remove_roles
await remove_roles(*roles, reason=None, atomic=True)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).
Removes [`Role`](https://discordpy.readthedocs.io/en/master/api.html#discord.Role "discord.Role")s from this member.
You must have the [`manage_roles`](https://discordpy.readthedocs.io/en/master/api.html#discord.Permissions.manage_roles "discord.Permissions.manage_roles") permission to use this, and the removed [`Role`](https://discordpy.readthedocs.io/en/master/api.html#discord.Role "discord.Role")s must appear lower in the list of roles than the highest role of the member.
can your bot remove roles?
yes. it can remove roles on other commands
do you have any ideas?
So I’m getting back into discord bots, what api is everyone using after discord.py went away?
Hi i dont know if i should ask this am guessing this is a #web-development type question but it wont let me import 'semantic-ui-css/semantic.min.css' this?
To design my buttons for my discord bot dashboard
mainly discord.py 2.0 and pycord (i think)
Theres a few. pycord is one of them. I prefer disnake though
so I just got rate limited for rerunning my bots code twice
Literally how
"Too many requests"
yeah i would say thats more #web-development
Everyone is still using the same api
It's the wrapper that changed
so can anybody help me make a command that removes a sertan role from everybody on the server?
I don’t understand y’all are still using discord.py? Even though it’s been archived on GitHub?
How long does rate limiting last?
I don't use it
And it still works
I saw pycord I’ll look into disnake thanks
Most people just don't want to switch
Are you using replit
yes
Ah ok what are you using then?
Got rate limited for running my bots code twice
That's why, multiple users share the same ip on replit
Disnake
Awesome I’ll look into it thanks
Yup
Well how long do they last?
They're dynamic, iirc from 30 minutes to an hour usually
Long term solution is not using replit/free hosts
Short term solution is waiting
is there a way i can have my bot repeat a message when i do a command? for instance
bot: hi
bot: hi
bot: hi```
Im trying to make an add role command but it keeps on saying missing permissions even though I have manage role in testing server here is the code:
@bot.command()
@has_permissions(manage_roles = True)
async def addrole(ctx, member: discord.Member, role: discord.Role):
await member.add_roles(role)
await ctx.send(f"Added role to {member}")
or do i have to individually type out "hi"
you can use a for loop
or a while loop
thanks ill look into it
show the whole code for that command
True
o
anyone knows how to fix it?
Send the full traceback
for loops
it should be
@commands.has_permissions(manage_roles=True)
umm they probably have it imported
eh maybe
they won't get "missing permission" error
ok
How do I make a giveaway for only people with a certain role
I have the giveaway part made I just need the role part
for member in ctx.guild.members:
role = discord.utils.get(member.guild.roles, name=(roleName))
await member.remove_roles(role)
when my code gets to this, it basically just skips over it
@final iron here is the full traceback
await add_roles(*roles, reason=None, atomic=True)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).
Gives the member a number of [`Role`](https://discordpy.readthedocs.io/en/master/api.html#discord.Role "discord.Role")s.
You must have the [`manage_roles`](https://discordpy.readthedocs.io/en/master/api.html#discord.Permissions.manage_roles "discord.Permissions.manage_roles") permission to use this, and the added [`Role`](https://discordpy.readthedocs.io/en/master/api.html#discord.Role "discord.Role")s must appear lower in the list of roles than the highest role of the member.
Does your bot have the appropriate permissions?
the added Roles must appear lower in the list of roles than the highest role of the member.
Have you read this note?
wait
yes
my role is the highest
wait i got the problem my bots role is lower than the role i need to add
let me see wether amking my bot the second highest role works
it worked thanks for the help
@client.command()
@commands.has_permissions(administrator=True)
async def removeAll(ctx, emoji=None):
author_id = ctx.author.id
if emoji == None:
await ctx.reply("I need a role to remove..")
return
newEmoji = emoji.split(":")
newEmoji2 = newEmoji[1]
roleName = newEmoji2.replace("_", " ")
for member in ctx.guild.members:
role = discord.utils.get(member.guild.roles, name=(roleName))
await member.remove_roles(role)
await ctx.reply(f"I have removed the `{roleName}` from everyone.")
when I run that, it runs the await ctx.reply(f"~~~~") thing, but it doesn't remove the role from everyone
camelCase

dont talk to me about it
it is
Remove the brackets around roleName
kk
still
Do you have member intents?
im sorry if im dumb, but i dont believe so
Personally I would suggest you just set all the intents to true
!d discord.Intents.all
classmethod all()```
A factory method that creates a [`Intents`](https://discordpy.readthedocs.io/en/master/api.html#discord.Intents "discord.Intents") with everything enabled.
how do i do that again?
Look above
SyntaxError: invalid syntax
Use this unless you have a specific reason to not have all intents enabled
spoonfeeding discord.Intents.all()
no error, but it still doesnt do anything
Did you do intents=discord.Intents.all() inside your bot constructor?
no
i have nothing about indents in my code
!intents
Using intents in discord.py
Intents are a feature of Discord that tells the gateway exactly which events to send your bot. By default, discord.py has all intents enabled, except for the Members and Presences intents, which are needed for events such as on_member and to get members' statuses.
To enable one of these intents, you need to first go to the Discord developer portal, then to the bot page of your bot's application. Scroll down to the Privileged Gateway Intents section, then enable the intents that you need.
Next, in your bot you need to set the intents you want to connect with in the bot's constructor using the intents keyword argument, like this:
from discord import Intents
from discord.ext import commands
intents = Intents.default()
intents.members = True
bot = commands.Bot(command_prefix="!", intents=intents)
For more info about using intents, see the discord.py docs on intents, and for general information about them, see the Discord developer documentation on intents.
So
In your bot constructor like shown above you would use the intents kwarg
Therefore intents=discord.Intents.all()
from discord import Intents
intents = Intents.default()
intents.members = True
PREFIX = "-"
client = commands.Bot(command_prefix=commands.when_mentioned_or(PREFIX), help_command=None, intents=discord.Intents.all())
```?
@final iron
RuntimeError: Event loop is closed
client = commands.Bot(command_prefix=commands.when_mentioned_or("-"), help_command=None, intents=discord.Intents.all())
You really just need that
You don't need to define intents since its not going to be used
well now i cant even run my bot 😦
Can you send the full traceback?
give me a minute
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
discord.errors.PrivilegedIntentsRequired: Shard ID None is requesting privileged intents that have not been explicitly enabled in the developer portal. It is recommended to go to https://discord.com/developers/applications/ and explicitly enable the privileged intents within your application's page. If this is not possible, then consider disabling the privileged intents instead.
Integrate your service with Discord — whether it's a bot or a game or whatever your wildest imagination can come up with.
discord.errors.PrivilegedIntentsRequired: Shard ID None is requesting privileged intents that have not been explicitly enabled in the developer portal. It is recommended to go to https://discord.com/developers/applications/ and explicitly enable the privileged intents within your application's page. If this is not possible, then consider disabling the privileged intents instead.
Learn to read your errors
frick
it works, ty!

lol i also had the same problem with removeall roles
it didnt remove anything
hey so the buttons stack for some reason, any way to make them not?
msgn = await ctx.reply(embed=embed,components=[
Button(style=ButtonStyle.green, label="MassPing", emoji='✅', custom_id="massping"),
Button(style=ButtonStyle.blue, label="MassJoin", emoji='✅', custom_id="massjoin"),
Button(style=ButtonStyle.red, label="Finish", emoji='❌', custom_id="cancel")
])```
using discord_components
make it into a 2d list
it should work afaik from what I've heard
still stacks
dk what you mean by 2d but i looked it up and i figured this
like the buttons work, they just stack
i used buttoncallbacks
and renamed it
like i copy and pasted it but renamed the "button_callback" thingy to "button_callback1"
then add like nunmbers after the "button_callback"
so it doesnt replace the new ones with the current
why set the label when its already done in the kwarg
idk
i just wrote it out of my memory
i tihnk it was because i had "button.disable" or something like that
and why the examples he hasnt even subclassed View
idk im kinda new to making discord bots so 
are you using discord-components?
yeah it was the first thing i learned for buttons so i just stuck with it
yikes
should i be using pycord for buttons or something 😭
disnake is good for buttons or just use master branch
you can , but pycord is not a too good fork imo
well , components for all forks remain same
So im using discord-components because yes... anyways while trying to get the person who clicked the button while inputing to a function to add to a database its saying it is missing a required argument
TypeError: MonkeyDataTools.check_for_user() missing 1 required positional argument: 'user'
ok so nevermind i have severe smoothbrainness
Do you have any code?
yes
@bot.command()
async def addon(ctx, user=None, days=None):
try:
if user == None:
embed = discord.Embed(color = discord.Colour.red())
embed.set_author(name='Addon Command')
embed.add_field(name="Error", value="`You Did not specify a user`")
embed.set_footer(text="Developed by Noelp")
await ctx.send(embed=embed)
elif days == None:
embed = discord.Embed(color = discord.Colour.red())
embed.set_author(name='Addon Command')
embed.add_field(name="Error", value="`You Did not specify a amount of days`")
embed.set_footer(text="Developed by Noelp")
await ctx.send(embed=embed)
elif Check_User(user) == False:
embed = discord.Embed(color = discord.Colour.red())
embed.set_author(name='Addon Command')
embed.add_field(name="Error", value="`The user is not in the DataBase`")
embed.set_footer(text="Developed by Noelp")
await ctx.send(embed=embed)
else:
for user in dbdate["Data"]:
print(user)
embed = discord.Embed(color = discord.Colour.green())
embed.set_author(name='Addon Command')
embed.add_field(name="Success", value="Bruh")
embed.set_footer(text="Developed by Noelp")
await ctx.send(embed=embed)```
oh ok
bot.variable = value
and if its a cog it would be self.bot right?
yea should be something like self.db = bot.db or however you made your db connection
makes sense
sorry I edited, it's not self.bot
Yup, or just self.bot.db
how can i tho
im making it in a async function but when i try to use it outside it its not defined
wdym
huh?
could you explain a little more
Hey, sorry for bothering you but I can't find it online may you please send an example?
async def dbc(self):
self.bot.dbc = await ...
you are making a db connection here?
yes
I usually make a db connection in my main.py, (bot subclass) as bot.db, then in a cog I just have self.db = bot.db and now self.db is a bot.db instance and you can do stuff normally like self.db.execute or whatever
never mind i got it
alr
sorry instances confuse me sometimes lol
Like a real smooth brain I open and close the connection in each command
happens
uh oh spaghettio
me rn: 🚶
And thats.... not the correct way
I think he knows
It not only makes the command slow, but can also result in your DB getting corrupted
Now that wouldn't be ideal
Indeed
Just like what Infernum does
i just did
async def dbconnection(self):
self.db = await aiosqlite.connect("")
How would I access this from a cog?
so each time i would just do
cursor self.db.execute(f"SELECT * FROM mytable;")
you add it inside the cog
since its a var inside of the class
So I have to define this in every cog?
you can probably make a bot var like shown above
^
let me do it myself smh idk why i havent
So if this is how I would execute the code, how would I commit?
commit by a db commit?
Yes
how do you commit normally?
if you made the bot var just bot.db.commit()
await connection.commit()
so you can just do
self.connection = bot.connection
await self.connection.commit or await self.connection.execute basically everything u would do normally
Aight
this is what i have in my subclass
async def connection(self):
self.bot.db = await aiosqlite.connect("")
and in my cog i have
self.db = bot.db
but its not working
in your bot subclass?
yes
no error?
did u add self.bot.db = None
in?
i doubt its needed
because in my cog its not saying its the coro but i do have it in my bot subclass
its too early for me ill help u later
relatable
My code now
🚪 🏃
😭
call the function
or use asyncio.loop.run_until_complete
wdym
call the connection function for the attribute to be set
the attribute wont be set unless that function is called
it says it is the attr but its just in grey and it says that the bot has no attr with it so its not making it a bot var
did you call the function?
!e ```py
class Foo:
def bar(self):
self.a = 10
foo = Foo()
try:
print(foo.a)
except AttributeError:
print("errr")
foo.bar()
print(foo.a)```
@lament mesa :white_check_mark: Your eval job has completed with return code 0.
001 | errr
002 | 10
what's the class in which you make the connection?
the bot subclass?
yes
so self would be the bot .., self.bot.db should raise an error imo
yes
make it self.db :p
that would be BotClass.db
still says
bot.db [db: any]
no need to redefine the db in a cog if it's already defined in your subclass imo
what's wrong with it?
ik
well its methods wont work ofc
have you checked the docs of your db and compared?
yes
there's a difference between the sync and async ones
yes ik
#bot subclass
async def dbconnection(self):
self.db = await aiosqlite.connect("")
cog
self.db = bot.db
just doesnt have the methods of the db
thats not it , the Any shows up in the cog right?
yes
you dont need to worry about that , its just because Bot object does not have that attribute
you defined it manually
instead if you typehint bot as your bot class in the cog's __init__ , it will appear as the Connection object
let me check
and it does make sense
😳 yes , but , since you are connecting to the db only after your bot is ready .... i doubt if it will do that
so , just print or ctx.send it using a command
wont work with me tho
their not in the same folder lol
so what , you can import it
How to close the connection when the bot is going off
no i cant
close connection from discord's websocket?
i think he ment the db connection
since you said it can corrupt itself
most dbs have a .close() method which u can use on disconnect method
!d discord.on_disconnect
discord.on_disconnect()```
Called when the client has disconnected from Discord, or a connection attempt to Discord has failed. This could happen either through the internet being disconnected, explicit calls to close, or Discord terminating the connection one way or the other.
This function can be called many times without a corresponding [`on_connect()`](https://discordpy.readthedocs.io/en/master/api.html#discord.on_connect "discord.on_connect") call.
Ok thx
ill use it
So when I make keyboard interrupt it will occur right?
but its called only when the bot closes automatically , not by yourself
I need it to close the connection on keyboard interrupt
Literally every time the bot finishes its work
Explicit calls to close, might be called as well gotta test
well if you are closing it by yourself , it means the whole script is stopping
so that code will never execute
for me , i close the database as soon i finish the reading/writing operation
Connection needs to be closed
And people say it's not the good practice
nah , you dont need to
I could implement it that way easily
alr
ik , im not dependent on my database completely so i do that
so should i make a command that closes the db?
you can..
and then turn off the bot
🚶
seems like a pain
doesnt the connection close as soon as the script stops running
im not sure
The connection closes when the close method is called ig or when the timeout occurs
docs says
async close() → None
Complete queued queries/cursors and close the connection.
so ig its like a return?
is it bad if i dont use a cursor var 🧍♂️
which docs are you using?
I remember my async db didn't need a cursor...
aiosqlite
i just do .execute() without a var
its optional , you can use the cursor , or the db connection itself
I'd just suggest you to use your cursor in a contextmanager I guess
async with aiosqlite.connect(...) as db:
db.row_factory = aiosqlite.Row
async with db.execute('SELECT * FROM some_table') as cursor:
async for row in cursor:
value = row['column']
await db.execute('INSERT INTO foo some_table')
assert db.total_changes > 0```
that's an example
rest would be [#databases](/guild/267624335836053506/channel/342318764227821568/)
thats from docs lol
correct
i used the generator to see the rows
just change the row_factory to avoid having to look "what index" your column is
not yet
🏃
Maybe after bot is shutted down I can just get new asyncio loop and run the coroutine that closes database connection after bot.run
nope, just overwrite your close function
class CustomBot(discord.Client): # or inherit commands.Bot
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
...
async def close(self):
await super().close()
# close the stinky db here```
correct
Alr ty
im not gonna even close the db connection🧑🦯
The garbage collector would probably handle it anyways
true, but this can be handy in case you for example want the "last time the bot closed/went offline" or whatever
I don't use it, nor do I implement such useless stuff
whats a __init__.py file for seen it many times but im confused as people say its to make your file like a module or make it like a tree for all imports
oh sorry
you can ask it here tho, but if you want fast answers, you can go in active textchannels
I'm not a mod lol
ic
My bot isn't sending the help message, there are no errors
is the help_command=None?
ic thanks
this works though
not sure why my other command doesn't
its helpful in imports and changing paths , like commands.Bot actually is discord.ext.commands.bot.Bot
isn't it in the core.py file? the bot class
discrd hmm
nope
seems like i replied to wrong message)
Okimii I am opening the rewrites repo soon!
you can soon see how diff it is now from dpy
YES
😔
now i can make my 9th bot
how would i do
+send #channel {text}
typehint the first param (after ctx ) as discord.TextChannel
i have a bot thats name newgen should i make it in lefi since lefi is the next generation wrapper?

@boreal ravine did you make any overwrite in the help class , other than send_help's?
!paste
Pasting large amounts of code
If your code is too long to fit in a codeblock in discord, you can paste your code here:
https://paste.pythondiscord.com/
After pasting your code, save it by clicking the floppy disk icon in the top right, or by typing ctrl + S. After doing that, the URL should change. Copy the URL and post it here so others can see it.
yes
I overwrited every method that started with send_
Bro what
bruh
No
Lefi is not being developed anymore
Since I'm making a rewrite right now of it
so what is it gonna be called😔
@bot.command()
async def test(ctx):
async with ctx.typing():
await asyncio.sleep(10)
await ctx.discord.TextChannel.send('ho')```
Rin,
is this what u mean?
bruh
😔
I got the repo private rn I will be opening it later
sad day
does the tag command actually exist?
im new to this what
how are you just now finding this out
I told you like a few times I was rewriting
then ill make a new bot in rin
yes
you didnt told me the name 🧑🦯
oh wait
overwriteded send_group_help?
yw
you are supposed to send it to a discord.TextChannel object, not the class directly
i said the parameter , not as a method
from __future__ import annotations
import asyncio
import logging
import os
import rin
logging.basicConfig(level=logging.DEBUG)
async def main() -> None:
token: str = os.getenv("DISCORD_TOKEN") # type: ignore
client = rin.GatewayClient(token, intents=32509)
@client.once(rin.Event.READY)
async def on_ready(user: rin.User) -> None:
print(f"Logged in as: {user.id}")
@client.on(rin.Event.MESSAGE_CREATE)
async def on_message(data: dict) -> None:
print(data)
await client.start()
asyncio.run(main())
``` Heres how it currently looks
Not to shabby
Also I am vaporizing any get_ methods
As now is a class specific cache
your starting from the start !!!!!!!!

E.g get_user -> rin.User.cache.get(id)
looks like a dpy fork🧑🦯
are you serious
im sorry😭
makes sense

The looks don't matter either how! Everything internal is super nice
And the package itself is typed strongly as of speaking
you got a good point
but can it beat disnake😳
maybe
👀
and how is making and api wrapper look so easy smh
what
looks easy to do idk you make it seem easy
some what easy 2 do for me cause I've made a few api wrappers already
:kek:
Wait, decorators inside function?
what?
In the example u gave 😐
bro
bot.run() doesn't exist
I meant asyncio.run(client.start())
whats future
!d future
Source code: Lib/__future__.py
__future__ is a real module, and serves three purposes:
• To avoid confusing existing tools that analyze import statements and expect to find the modules they’re importing.
• To ensure that future statements run under releases prior to 2.1 at least yield runtime exceptions (the import of __future__ will fail, because there was no module of that name prior to 2.1).
• To document when incompatible changes were introduced, and when they will be — or were — made mandatory. This is a form of executable documentation, and can be inspected programmatically via importing __future__ and examining its contents...
stdlib
oh
tbh I think for this rewrite I'm gonna not add run
Not sure if it's needed
hey im getting this error but when i try to install DiscordUtils[voice] it says no matches found: DiscordUtils[voice]
1 what command are you executing?
2 where did you get it from?
you probably installed discordutils, but not discordutils[voice] (see it as an add-on)
https://pypi.org/project/DiscordUtils/
i was following the music example
how have you tried to install the lib?
pip install DiscordUtils[voice] this command?
yes
can't be
unless you're in a venv
what happens when you run the said command? does it say 'requirement already satisfied"?
what python version do you have?
3.9.6
installed via pip before?
only for discord.py
That's weird because it actually works for me
Try using python3.9 -m pip install DiscordUtils[voice]
still getting no matches found
Try installing from GitHub
i was able to install DiscordUtils fine but its only DiscordUtils[voice] that doesn't work. if i download from Github won't it just download DiscordUtils?
U can do
git clone url
cd folder
pip install .[voice]
Where url and folder are in respect to GitHub
Or just copy paste this file inside the DiscordUtils installation
https://github.com/toxicrecker/DiscordUtils/blob/master/DiscordUtils/Music.py 😳
🤣 facts
Facts
DiscordUtils/Music.py line 294
class Song(object):```
Lmao what is this python 2?
badly written -> easier to understand to me hehe
Bad naming lol
no
file names should be in lower case
My man still living in Python 2.6 era
PascalCase is meant only for classes ryt
Yea
☠️why would someone intentionally write it in 2.x , dpy is supported only after 3.5 iirc
wait sorry i left for a sec
It's fine
was there anything i should try to get it to work?
Yea...
Doubt they wrote it in python 2 but class Foo(object): ... something no longer needed
Was required in python 2 though
😔
Yea
url = ""
🧑🦯
url = str()
ok so i got it downloaded
async def ytbettersearch(query):
url = f"https://www.youtube.com/results?search_query={query}"
async with aiohttp.ClientSession() as session:
async with session.get(url) as resp:
html = await resp.text()
index = html.find('watch?v')
url = ""
while True:
char = html[index]
if char == '"':
break
url += char
index += 1
url = f"https://www.youtube.com/{url}"
return url
url = "" 🧑🦯
if it was in rust 😳
let link : &str
My man drinking too much lately
🤸🏌️
for (const auto &link : str) cpp
cpp god 👀
I'm striving to become a React God by not learning React by learning it
im going to learn ruby or php😳
When you realize it's called React cause it uses reactive programming paradigm
just learn python and make discord bots 
Learning React cz a friend of mine, with whom am making a project, wants me to 
ngl idk if i did this right
Tf?
i googled it 😭
Lmfao
@static lintel just do this
like in the folder?
No I meant that's correct
Oh you cloned the wrong folder
going to learn swift feeling like a boss you already know😎
!e
for number in range(100, 8):
print number
@copper gulch :x: Your eval job has completed with return code 1.
001 | File "<string>", line 2
002 | print number
003 | ^^^^^^^^^^^^
004 | SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
copy the content in Music.py , paste it inside the DiscordUtils you installed , go to __init__.py and from .Music import * add this ( this is 1 way of doing that )
Oh yea
print with no parenthesis, python 2 moment
print([num for num in range(100, 8)]) tho it isn't gonna print anything
2.0 could do that🧑🦯
@timid wagon hi
Yes hoi
Yea xd
Output is 0
Let's go back and start coding in Python 2 again
import music is already there tho?
hmmm anything else i should try?
going to sleep gn🛌
Nah , it should work now
still getting the same error
What's the error? And your code
i don't want to be the person but it uses ytdl
Ik
But ig we have helped them till here, let's just finish it. Won't be helping with more code issues after this 🤷♂️
do i still need to show since i followed the example line for line?
Yea... Show yr imports and file structure
And file structure
im sorry im new to this. what is a file structure? 😭
like this?
Which IDE u using? There should be a files and folder list on the left side of the window
This is your whole folder where every bot file is present?
i think im gonna learn ruby🧑🦯
yeah i haven't touched anything
Do one thing... In your IDE, go to the open tab, and select Open Folder and open the folder named learning python since that's the main folder with every bot file
I mean as per the error you received, you installed the package without voice
no🏃 rubys syntax looks easy and some what like python
We tryna do something else
I guess I'm late to the party xP
Lua's syntax is also identical to Python...
@nextcord.slash_command(name = "kick",description="kick a member",guild_ids=[ServerID])
async def kick(self,interaction:nextcord.Interaction,member:nextcord.Member=None,*,reason:str = SlashOption(default = "no reason provided",required = False)):
await interaction.response.defer()
self.bot_user = self.client.get_user(self.client.user.id)
if interaction.channel.permissions_for(interaction.user.id).kick_members is True and interaction.channel.permissions_for(self.bot_user).kick_members is True:
if member is None:
return
await member.kick(reason=reason)
embed = nextcord.Embed(description=f"{interaction.user.mention} kicked {member}")
await interaction.followup.send(embed = embed)```
Sure u r...
xD*
AttributeError: 'int' object has no attribute 'id'```
Yea perfect
sorry that took so long
no🏃
It's fine. Opening the whole folder is better since that way u can quickly access each file without opening repeatedly
Yes 🏃
looks like if ruby and python had a baby
Lmaoo
Do one thing... Move the DiscordUtils folder out of the DiscordUtils-master folder
The whole folder
Just drag the folder out of the other folder and place it with other files
self.client.user ???
???
ok ok just finished this
Now delete the other discord utils master folder
done
Sooo?
Now, do from .DiscordUtils import Music in your imports
Now u should be able to do music = Music()
Ik
It's Music bot
that module violates TOS
Music not music
Ik
oops lol
@twin moon ^^^
uh i somehow managed to get a new error
Ah thought so haha
Add this line before importing music
from sys import path
path.insert(1, ".")
Gonna work then (:
i still got the same error message
'ClientUser' object has no attribute '_roles'
Show code
Weird
@nextcord.slash_command(name = "nickname",description="kick a member",guild_ids=[ServerID])
async def nickname(self,interaction:nextcord.Interaction,member:nextcord.Member = None,*,nickname:str = SlashOption(default = None,required = False)):
await interaction.response.defer()
if interaction.channel.permissions_for(interaction.user).manage_nicknames is True and interaction.channel.permissions_for(self.client.user).manage_nicknames is True: #HERE
await member.edit(nick=nickname)
await interaction.followup.send(f"{member} nickname has been changed to {member if nickname is None else nickname}")```
if
permissions_for(obj, /)```
Handles permission resolution for the [`Member`](https://discordpy.readthedocs.io/en/master/api.html#discord.Member "discord.Member") or [`Role`](https://discordpy.readthedocs.io/en/master/api.html#discord.Role "discord.Role").
This function takes into consideration the following cases...
ClientUser is a member
NO
property me: discord.member.Member```
Similar to [`Client.user`](https://discordpy.readthedocs.io/en/master/api.html#discord.Client.user "discord.Client.user") except an instance of [`Member`](https://discordpy.readthedocs.io/en/master/api.html#discord.Member "discord.Member"). This is essentially used to get the member version of yourself.
property me: nextcord.member.Member```
Similar to [`Client.user`](https://nextcord.readthedocs.io/en/latest/api.html#nextcord.Client.user "nextcord.Client.user") except an instance of [`Member`](https://nextcord.readthedocs.io/en/latest/api.html#nextcord.Member "nextcord.Member"). This is essentially used to get the member version of yourself.
There bruv
Yea... So?
!d discord.abc.GuildChannel

