#discord-bots
1 messages · Page 459 of 1
now both the event and the command are inside a command
please pay attention to your indents
it's inside a command
i

that command is a literal RuntimeWarning inc
idk how dank memer isn't getting ratelimited yet
speed run "hacking"
well its just gonna raise you a ton of warnings in your console
dank memer has cooldown
Anyways POGGGG
on every command
also, since it's one of the biggest bots ever, the devs have probably asked discord for some priority
K i actually added await to asyncio
Hi, so I have a bot with some commands, nothing too fancy. One thing I wanted to to is that, after certain command, my bot would be able to answer messages that contains certain words. In order to do this, I defined the on_message behaviour, but now none of my commands works.
discord components help ?
I see, thank you so much
no worries!
!d discord.ext.commands.Bot.process_commands
await process_commands(message)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).
This function processes the commands that have been registered to the bot and other groups. Without this coroutine, none of the commands will be triggered.
By default, this coroutine is called inside the [`on_message()`](https://discordpy.readthedocs.io/en/stable/api.html#discord.on_message "discord.on_message") event. If you choose to override the [`on_message()`](https://discordpy.readthedocs.io/en/stable/api.html#discord.on_message "discord.on_message") event, then you should invoke this coroutine as well.
This is built using other low level tools, and is equivalent to a call to [`get_context()`](https://discordpy.readthedocs.io/en/stable/ext/commands/api.html#discord.ext.commands.Bot.get_context "discord.ext.commands.Bot.get_context") followed by a call to [`invoke()`](https://discordpy.readthedocs.io/en/stable/ext/commands/api.html#discord.ext.commands.Bot.invoke "discord.ext.commands.Bot.invoke").
This also checks if the message’s author is a bot and doesn’t call [`get_context()`](https://discordpy.readthedocs.io/en/stable/ext/commands/api.html#discord.ext.commands.Bot.get_context "discord.ext.commands.Bot.get_context") or [`invoke()`](https://discordpy.readthedocs.io/en/stable/ext/commands/api.html#discord.ext.commands.Bot.invoke "discord.ext.commands.Bot.invoke") if so.
you need to add await bot.process_commands(message) in your on_message event
Thanks!
interaction = await bot.wait_for("select_option")
label = interaction.component[0].label
if label == "Moderation":
await interaction.respond(
ephemeral=True,
embed=embed1
)
``` wont woork
hi, why does the error handler return in console instead of sending a message? i'm really confused lol
you wrote that incorrectly
should be: if isinstance(error, commands.CommandOnCooldown
also, on_command_error takes error and ctx parameters. when here, you put self, ctx
why is there self it isnt even in a class
yeah im wondering that too
@lofty heron
@patent lark hey can i dm u
sure
does anyone know how to send embeds using discord components
embeds are different than components i believe
@patent lark can you check #help-lollipop kindly
okay.
how tf do i fix this
@bot.command()
async def about(ctx):
embed = discord.Embed(
title = 'About Me',
description = 'This bot was developed by syskey.exe#9999',
color = discord.Color.red()
)
embed.set_footer(text=f'Requested by = {ctx.author}', icon_url=ctx.author.avatar_url)
embed.add_field("Hey, wassup, my name is Kuno and im here to make your discord server better and make your life easier lol")
await ctx.send(embed=embed)
this is the code
@client.event
async def on_raw_reaction_remove(payload):
print(payload.user_id)
guild = client.get_guild(payload.guild_id)
member = discord.utils.get(guild.members, id=payload.user_id)
i remove a reaction and member is none, how and why is this happening
yeah this just does not work
@tasks.loop(seconds=5)
async def change_status():
channel = Bot.get_channel(id)
await channel.send(f"{random.choice(thoughts)}")
There's guild.get_member btw
Bot should be your bot instance
Are you sure
Bot = commands.Bot(command_prefix="v!")
yea ok its fine either way but how do i make it return the member
wdym
ok
i need member to be a member object of whoever unreacted it
@tasks.loop(hours=1)
async def change_status():
channel = Bot.get_channel(735715319783489580)
print(735715319783489580)
await Bot.channel.send(f"{random.choice(thoughts)}")```
so like this
im a bit special
that may be where i went wrong
should it be
await ctx.send(f"{random.choice(thoughts}")```
ctx doesn't even exist
im a idiot
!d discord.TextChannel.send
await send(content=None, *, tts=False, embed=None, file=None, files=None, delete_after=None, nonce=None, allowed_mentions=None, reference=None, mention_author=None)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).
Sends a message to the destination with the content given.
The content must be a type that can convert to a string through `str(content)`. If the content is set to `None` (the default), then the `embed` parameter must be provided.
To upload a single file, the `file` parameter should be used with a single [`File`](https://discordpy.readthedocs.io/en/stable/api.html#discord.File "discord.File") object. To upload multiple files, the `files` parameter should be used with a [`list`](https://docs.python.org/3/library/stdtypes.html#list "(in Python v3.9)") of [`File`](https://discordpy.readthedocs.io/en/stable/api.html#discord.File "discord.File") objects. **Specifying both parameters will lead to an exception**.
If the `embed` parameter is provided, it must be of type [`Embed`](https://discordpy.readthedocs.io/en/stable/api.html#discord.Embed "discord.Embed") and it must be a rich embed type.
ok imma try that
try this and make sure to use ```py
from discord.ext import Embed
```py
@bot.command()
async def About(ctx):
embed = Embed(title="About me", description="This bot was developed by syskey.exe#9999")
embed.add_field("Hey, wassup, my name is Kuno and im here to make your discord server better and make your life easier lol", inline=False)
embed.set_footer(text=f'Requested by = {ctx.author}', icon_url=ctx.author.avatar_url)
await ctx.send(embed=embed)
Reactions to a message. Reactions can be either custom emoji or standard unicode emoji.
That does not help wtf
!id
whats the code something like this
if user id=discord id here
@bot.command(aliases=['bc'])
@commands.has_permissions(manage_messages = True)
async def botclear(ctx,amount=100):
await ctx.channel.purge(limit = amount)
await ctx.send( f'{ctx.author.mention} cleared bot messages')
i want to make it so only the messages of bots gets cleared
message.author == bot.user
Can some one tell me what's the complete command to instanl pip install discord new version
pip install -U discord.py
Just this?
Yea
Tysm
i want my bot to only delete bot messages
Your bot's messages or what?
!d discord.TextChannel.purge there's a check kwarg
await purge(*, limit=100, check=None, before=None, after=None, around=None, oldest_first=False, bulk=True)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).
Purges a list of messages that meet the criteria given by the predicate `check`. If a `check` is not provided then all messages are deleted without discrimination.
You must have the [`manage_messages`](https://discordpy.readthedocs.io/en/stable/api.html#discord.Permissions.manage_messages "discord.Permissions.manage_messages") permission to delete messages even if they are your own (unless you are a user account). The [`read_message_history`](https://discordpy.readthedocs.io/en/stable/api.html#discord.Permissions.read_message_history "discord.Permissions.read_message_history") permission is also needed to retrieve message history.
Internally, this employs a different number of strategies depending on the conditions met such as if a bulk delete is possible or if the account is a user bot or not.
Examples
Deleting bot’s messages
Guys is there any module to make a youtube video notifier?
I don't think so
@maiden fable well it is not breaking the tos of yt right?
@client.command()
async def test(ctx):
global headers
s = requests.Session()
id_list = [int(123), int(1234), int(12345), int(12344), int(222234), int(1234234)]
for _id in id_list:
r = s.get(f'https://example.com/{_id}', headers=headers)
res = r.json()
for doc in res:
name = doc['name']
due = doc['due_at']
if due == None:
print(f'{name} -- {due}')
else:
example = due
actual_date = example.strip('Z')
d = datetime.datetime.fromisoformat(actual_date)
due_date = d.strftime('%Y-%m-%d')
webhook = DiscordWebhook(url='https://discord.com/api/webhooks', username='test')
embed = DiscordEmbed(title='test', description=f'\n{name}\n{due_date}', color='0xffffff')
embed.set_author(name="test")
embed.set_timestamp()
webhook.add_embed(embed)
webhook.execute()
time.sleep(0.5)```
yo how do i make it just send one big webhook instead of each individual item within the webhook
I don't think so
Mine (embed=embed) showing some problem
code?
how do you do this?
Epoch Time
OH ty
hm
embed = discord.Embed()
wut
???
Paste the code here
??? you said embed=discord.Embed() what was that for?
@bot.command()
async def About(ctx):
embed = Embed(title="About me", description="This bot was developed by Roboleon")
embed.add_field("Hey, wassup, my name is Piro Bot. Im here to make your discord server better and make your life cool in this app ", inline=False)
embed.set_footer(text=f'Requested by = {ctx.author}', icon_url=ctx.author.avatar_url)
await ctx.send(embed=embed)
O
@bot.command()
async def About(ctx):
embed = discord.Embed(title="About me", description="This bot was developed by Roboleon")
embed.add_field("Hey, wassup, my name is Piro Bot. Im here to make your discord server better and make your life cool in this app ", inline=False)
embed.set_footer(text=f'Requested by = {ctx.author}', icon_url=ctx.author.avatar_url)
await ctx.send(embed=embed)
o
@thorny current
my bad
after adding a cog to Cogs what to do
copy that?
it says command not found
Make commands?
it should work
Ok
!d discord.Embed
class discord.Embed(**kwargs)```
Represents a Discord embed.
`len(x)` Returns the total size of the embed. Useful for checking if it’s within the 6000 character limit.
Certain properties return an `EmbedProxy`, a type that acts similar to a regular [`dict`](https://docs.python.org/3/library/stdtypes.html#dict "(in Python v3.9)") except using dotted access, e.g. `embed.author.icon_url`. If the attribute is invalid or empty, then a special sentinel value is returned, [`Embed.Empty`](https://discordpy.readthedocs.io/en/stable/api.html#discord.Embed.Empty "discord.Embed.Empty").
For ease of use, all parameters that expect a [`str`](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.9)") are implicitly casted to [`str`](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.9)") for you.
what shld my init file contain
you seen you only did embed=Embed and not embed=discord.Embed
Show me the code
Maybe you forgot to indent the commands?
Yea worked
Hey hi,
Can anyone help me out with making a VC alert command
About the command -
If a member joins a VC then the bot would send a message to send a message in channel and after every x hours the bot would ask to the member to send some message in the same channel
from discord.ext import commands
bot = commands.Bot(command_prefix='$')
class Moderation(commands.Cog):
def __init__(self, bot) -> None:
self.bot = bot
super().__init__()
@commands.command
@commands.has_permissions(manage_messages=True)
async def purge(self, ctx, amount=10):
if amount.isnumeric():
amount = int(amount)
else:
amount = 10
if amount <= 0 or amount >= 101:
await ctx.send("enter an integer within range 0-100")
else:
await ctx.channel.purge(limit=amount)
def setup(bot):
bot.add_cog(Moderation(bot))
bot.run('token')
You forgot the parentheses on the command
Now it's showing problem in from discord.ext import embed
oh
dont do that
remove that
just import discord
Ohk
it still says command not found
y ur cog so weird
cogs aren't supposed to have prefixes or bot.run in them
oh
Heres an example
class MyCog(commands.Cog):
def __init__(self, bot):
self.bot = bot
@commands.command()
async def example(self, ctx):
def setup(bot):
bot.add_cog(MyCog(bot))
so you where you put the token?
Is there any other way or any other language that can do this along with python
you don't
you put it in the main.py file
yes
.
A Cogs Example for the rewrite version of - discord.py - bot_example.py
thabks
!d discord.on_voice_state_update
discord.on_voice_state_update(member, before, after)```
Called when a [`Member`](https://discordpy.readthedocs.io/en/stable/api.html#discord.Member "discord.Member") changes their [`VoiceState`](https://discordpy.readthedocs.io/en/stable/api.html#discord.VoiceState "discord.VoiceState").
The following, but not limited to, examples illustrate when this event is called...
@client.event
async def on_member_join(member):
channel = client.get_channel(876172211646504980)
role = discord.utils.get(member.guild.roles, name='Member')
embed = discord.Embed(
title = '',
description = '',
colour = blue
)
embed.set_footer(text='By oSeatch#6969')
embed.add_field(name='Welcome!', value='Has joined the server!', inline=False)
await channel.send(embed)
await member.add_roles(role)``` can someone tell me where im going wrong
its giving me this
did someone say something i didnt notice
@client.event
async def on_member_join(member):
channel = client.get_channel(876172211646504980)
role = discord.utils.get(member.guild.roles, name='Member')
embed = discord.Embed(
title = '',
description = '',
colour = discord.Colour.random
)
embed.set_footer(text='By oSeatch#6969')
embed.add_field(name='Welcome!', value=f'{member.mention} Has joined the server!', inline=False)
await channel.send(embed)
await member.add_roles(role)``` changed it to this.. still not working
@maiden fable can u plz help me
Intent?
colour = discord.Colour.random()
TypeError: Expected discord.Colour, int, or Embed.Empty but received method instead.``` getting this error
.random() is a function
With?
whaa ok i am try
@maiden fable do u know any event that can trigger the bot to send a msg but that event is not related to any member or roles or guild
@slate swan not cmd nor on_msg
Or task
@maiden fable maybe
task is for repetition
it would be helpful if you could elaborate on what you were trying to do
Not always
well its working now but umm
channel.send(embed=embed)
channelList= self.ytData[guild]['ytchannels'] channelList.append(channellink)
Dict obj has not attribute append
alr doing
I am trying to make a youtube notifier, like whenever someone uploads a video it will send a msg but which event will it use to send that I mean how can I makee it msg at that time @slate swan
embed = embed
@tasks.loop()
you would use tasks.loop to check if there is a new video every x intervals
if there is, send a message to specified channel, if there isnt, well do whatever you want to do
Anyone?
to append to a dict you can just use dict['key'] = 'value' no?
What does dict stands here according to my code?
File "main.py", line 55, in on_raw_reaction_remove
await member.remove_roles(role)
AttributeError: 'User' object has no attribute 'remove_roles'
how does it happen, i got the variable member with a client.fetch_user
im pretty confused myself so ill let someone else reply 
Some problem here
you need a member object not a user object
any way of convertion?
not afaik
get the guild then the member from the guild
you need intents
channelList = self.ytData['ytchannels'] channelList.append(channellink)
This works
Guys is there any module that can search for videos using the channel id in YouTube
But not that guildone
member = await client.get_guild(885320179251290152).get_user(payload.user_id)
since i only want it to work in one server it should work?
Guys is there any module that can search for videos using the channel id in YouTube
how do i get the guilds total emoji limit??
i did this its giving 50 but the guild had 100 emojis

perhaps it gives only regular emote limit, not animated
doesnt say anything in the docs
then?
then just multiply the limit by 2 and you get the total limit?
If i add slash commands to my bot will it be autimatically registered in the existing servers that my bot is already in?
You need the api key from youtube
Didn't get it after searching ;-;
The value thingy didn't got
how doi get the names of the members as a list from a msg reactions?
@waxen granite how will I get the videos I am getting mad lol
embed.add_field(name = " name of the field" , value = "what value you want to add")
;-; add_field takes two values
name and value ;-;
look at what your doing ;-;
and learn to read the docs and compare your code with it ;-;
Wdym? "Other language that can do this along with python"
idk about any other way though
@slate swan can u help me with the api
I am very much confused
How to use it to get the videos with the channel id
You just need to register an API key on developer page of google and make requests using it
Idk if any wrapper exists or not
@slate swan ok but how
I got one wrapper but that does everything else other than the thing I want it to do
Read the docs I shared and find the proper endpoint.
Prepare the data it asks for and send it along the request.
Send the authorization token in headers like {'Authorization': 'Bearer oauth_key'}
Ah I am getting confused
Some API stuff, you need to learn rest apis and stuff to understand this
I recommend continue finding some wrapper
@slate swan request module will work here?
@slate swan I am searching this for my discord bot so what should I use
Request or aiohttp
?????????????????????
Aiohttp
How to count role position according to role hierarchy?
Aiohttp will make request to the api ?@slate swan
!d discord.Role.position
The position of the role. This number is usually positive. The bottom role has a position of 0.
It will let you make requests, you need to make them yourself
How do i get the top role as position 0?
it won't work like ```py
aiohttp.get_youtube...
does anyone know how i would go about making a user phone command in discord.py? i allready have my own userphone but it uses dictionarys and if two people do the function to call or ring at the same time it does a error where the data changed while it was changing
I can't explain whole API stuff rn 
You can search on google how to make requests and use api
O_o
!e ```py
x = [1, 2, 4]
x.reverse()
print(x)
@slate swan :white_check_mark: Your eval job has completed with return code 0.
[4, 2, 1]
@waxen granite get the list of roles and use reverse ^
!e
x = [1,2,3]
print(x[::-1])
@slate swan :white_check_mark: Your eval job has completed with return code 0.
[3, 2, 1]
@client.event
async def on_raw_reaction_remove(payload):
member = client.get_guild(payload.guild_id)
member = member.get_member(payload.user_id)
print(type(member)
why does it print None
!d discord.on_raw_reaction_remove
discord.on_raw_reaction_remove(payload)```
Called when a message has a reaction removed. Unlike [`on_reaction_remove()`](https://discordpy.readthedocs.io/en/stable/api.html#discord.on_reaction_remove "discord.on_reaction_remove"), this is called regardless of the state of the internal message cache.
This requires [`Intents.reactions`](https://discordpy.readthedocs.io/en/stable/api.html#discord.Intents.reactions "discord.Intents.reactions") to be enabled.
ok ill google how to enable it
you forgor the closing ) at the end 👽
***how doi get the names of the members as a list from a msg reactions?***
oh right i didnt copy that from my code
but yea i did put it
how to enable intents.reactions tho
Intents.reactions = Truein your main.py
after the imports?
intents = discord.Intents.default()
intents.reactions = True
client = commands.Bot(command_prefix = get_prefix, intents=intents)
remove the get_prefix
Ye
tysm
Before client/bot
ill try it
Anyone?
does anyone know how i would go about making a user phone command in discord.py? i allready have my own userphone but it uses dictionarys and if two people do the function to call or ring at the same time it does a error where the data changed while it was changing
@slate swan
how can i change on my bot presence?
hi guys does anyone know how to link a python program back to discord framework
or where to learn
What do you mean by "link a Python program back to Discord framework"
ok i did the changes and its still nonetype
i mean like i basically have my program do what i need it to do and now when it sucessful does what it needs to do i want to to ping me in discord in my server
Use a Discord API wrapper
I want to store a message object in a database, can someone help me out as to how to do that
it still doesnt work so ill just say what i want to accomplish, i could get the user object with client.get_user and idk how to remove roles from user object
that means message.guild is None, that may mean you're dming the bot
Of?
i want that people can dm the bot :/
!e
import time
import asyncio as time
time.sleep(1)
i have a command >dmuser [user id] [msg] and if someone reply my bot in dm i got the reply in embed but yesterday i made a giveaway gunction after that this is not working :/
Check if message.guild is None
client.wait_for("message") needs intents.presences = True?
how ?
this is code
if message.guild is None: return
??
it doesnt need intents right?
oo not that this is code
No
but it doesnt work :l
it works if there is intents.all()
intents.messages 👀
message.guild.id isnt a thing
!d discord.Intents.messages
Whether guild and direct message related events are enabled.
This is a shortcut to set or get both guild_messages and dm_messages.
This corresponds to the following events...
than how i can check guild's id?
They were asking intents.presences
but i want to check the msg guild

it is in the on_message
how do i set a custom attribute of discord.Guild as something like a dict? because thats the only way i think i can possibly store the urls of a music bot
My bad
!d Guild.id
message*
!d discord.Message.guild
The guild that the message belongs to, if applicable.
o
The guild’s ID.
thats on_message
@steep estuary u said id ur putting a string where ur supposed to put the id
No lol
yes
is it wrong?
very
Yea
id
than ?
That would never be true
what should i use
paste the server id ig?
it will also check the server's id?
you cant check a server id with a string
if message.guild.id == id:
this is only giving error :/
The guild’s ID.
show me
replace the guild.id with message.guild.id
i meant replace LegendServer with your guild id
that is giving error
if message.guild is none it means its in a dm
legend server is a variable which have my server's id
maybe try using the id
k
show me the var
if message.guild and message.guild.id == LegendServer
That means it wont error if its in dms
Ah anyone here who know how to make a youtube notifier
hm
everything was working perfect
but i made yesterday a giveaway function
after that some of my old commands are not working
Anyone?
message.guild also check id?
Well, i mean. I guess im saying it again. If its None, it generally means the message is in dms
And so you want to check for it first
can someone please help me
@slate swan post ur question
Thats what that does yep.
how do i set a custom attribute of discord.Guild as something like a dict? because thats the only way i think i can possibly store the urls of a music bot
Ah anyone here who know how to make a youtube notifier
@slate swan what is ur music bot using?
ytdl
Mine uses discord utils
!ytdl
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)
I cannot help
what? lmfao
Its slotted iirc, so youll need to make some form of wrapper class and inject it wherever you want/need it
oh
Better to just put it on bot
@valid perch u r helping him to break the tos of yt bud by helping him in his bot
it works with me but
it keep spamming like "while True"
@client.listen()
async def on_message(message):
if message.guild.id == 864528215036002314:
await message.channel.send("test")
He asked how to set a variable to store a url, not how to play music. Sue me
isnt this gonna spam ur server
.
The bots own messages also trigger that event, so you want to check if its a bot and return
because its sending a message and reciving that message and bc its in the same guild it sends another one repeating the cycle
oh ye ye
@valid perch I agree though its a bot related to yt
ye i got it i got it
does anyone know how i would go about making a user phone command in discord.py? i allready have my own userphone but it uses dictionarys and if two people do the function to call or ring at the same time it does a error where the data changed while it was changing
Do as u want bud
@slate swan don't ping me bud just post the question no need to reply
oo it worked
@client.command()
async def templates(ctx):
try:
res = requests.get("https://api.imgflip.com/get_memes")
if res.status_code == 200:
data = res.json()
embed = discord.Embed(color=0x000000, title="Templates")
for i in (data['data']['memes']):
memeId = i['id']
memeName = i['name']
memeLink = i['url']
embed.add_field(
name=memeName, value=f"`Image:` {memeLink} - `ID:` {memeId}", inline=False)
await ctx.send(embed=embed)
except:
print("Error")```
It's actually printing Error, what did I do wrong?
remvoe the try except and diagnose the error
does it have a id key in the dict?
there might be too many fields
i think the max is 24
well
try do print(len(embed)) before sending the embed
and tell me the output it gives
ok
5919 😂
well the max characters you can have in a embed is 6000 so that will be the reasonf or error
How can i set what action(ie disable it or somthn like that) to take place upon my view (Select menu etc) getting timed out ... ? (dpy 2.0)
oh ok
how to make embed pages?
like dank memer does
how do i store a message object in a file or database so that i can call it anytime
with media too?
everything
yeah i know how to access stuff in the message object
what i want is the entire message stored
reactions, id, channel id, guild
everything
yeah but doing the thing separately is a drag
I want to call the entire message later and use it
is there something like on vc join event?
how to edit msges
await msg.edit
what is problem?
edit not edit_message?
why is not working pls help me
yep it works like this
msg = await ctx.send("hey")
await msg.edit("hi")
whats the problem
k
i do on my discord server verify and is not working
also consider renaming client to bot if you are using bot constructor and not discord.Client
me?
yes
any traceback?
Traceback (most recent call last):
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/ext/commands/core.py", line 167, in wrapped
ret = await coro(*args, **kwargs)
File "main.py", line 40, in setaichannel
await c.execute("UPDATE data SET datan = ? WHERE rowid = 2", (str(channel.id)))
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/aiosqlite3/cursor.py", line 130, in execute
res = yield from self._execute(self._cursor.execute, sql, parameters)
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/aiosqlite3/cursor.py", line 56, in _execute
res = yield from self._conn.async_execute(func, *args, **kwargs)
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/aiosqlite3/connection.py", line 137, in async_execute
return (yield from self._execute(func, *args, **kwargs))
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/aiosqlite3/connection.py", line 126, in _execute
future = yield from self._loop.run_in_executor(
File "/usr/lib/python3.8/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
sqlite3.ProgrammingError: Incorrect number of bindings supplied. The current statement uses 1, and there are 18 supplied.
try await msg.edit(content="hi")
k
what is problem?
how can i create bot variable im new to python
i think now it will work for sure advance tysm @hasty loom 🙂
then please consider learning python beforehand, discord bot isnt something beginners should do
bot = commands.Bot(command_prefix="!")
pls dont spoonfeed
Hi, is a API available for compiling LaTeX?
then use @client.command
e
bro it is editing but it is stucking like 50 than direct 45
wym
then why are you doing bot.command() if your variable name is client?
maybe he copied the command?
show code snippet
help
yeah he said hes new to python
which is why i told him to learn python before trying to make a bot lol
hm
i mean it is editing from 50 to 0 but stucking in between like 50 -> 49 -> 48 than -> 45
thats called being rate limited
await ctx.channel.send("Hello, World!", components = [
Select(
placeholder = "Select something!",
options = [
SelectOption(label = "A", value = "A"),
SelectOption(label = "B", value = "B")
]
)
]
)
event = await client.wait_for("select_option")
print(event.component)
Why it returns None?
I don't use 2.0 yet so idrk
@client.command()
async def test(ctx):
embed = discord.Embed(color=0x000000)
# dsInvite = await ctx.channel.create_invite()
embed.set_thumbnail(url=f"{ctx.author.avatar_url}")
embed.add_field(name="Author", value=f"<@!{ctx.author.id}>", inline=False)
embed.add_field(name="Channel", value=f"<#{ctx.channel.id}>", inline=False)
embed.add_field(name="Server", value=f"{ctx.guild}", inline=False)
# embed.add_field(name="Server invite", value=f"{dsInvite}", inline=False)
embed.add_field(name="Message", value=f"{ctx}", inline=False)
await ctx.reply(embed=embed, mention_author=False)```
I want it to send also the message content but it doesn't
ctx.content?
doesn't even work
did anyone make a music command
I tried use ffmpeg
but the one i made
and youtube_dl
Ik
ctx is context object, you need to pass ctx.message.content for the content of the message that triggered the content
ooh
have a look at this
https://github.com/Rapptz/discord.py/blob/master/examples/basic_voice.py
oh
ok
luv u
I needed it too ty
as u can see I made 2 lines of code as comment
I'm wondering
does it create a new invite everytime I run the command?
yup
I don't wanna spam server log of invites
how to make it only once
I read that basic is infinite so I need it one time only
just take the first one from guild.invites?
probably add a check for how much time is left for the invite and if there isnt one, make a new one
or make a invite with no time limit, store that and send it each time
I've read the docs, default is 0 for time and 0 for uses, so basically it's an infinite invite
is it possible for a bot to steam?
o okie
what
stream* and no
oh
mb okay thanks
np
i see
well
this test command it's meant to be a real-time log
like
test
and the bot logs every message sent after the command

lol
Ik it's strange
I need logs for some chats
example
owner is offline and ppl starts send nsfw and shi
the chat gets logged
@slate swan
BaseException is a pre defined keyword, change it's name to something else
ok
if you want the embed to be dark dont use the color kwarg
@client.command()
async def send_dm(ctx, member: commands.MemberConverter, *, content):
channel = await member.create_dm()
embed = discord.Embed(color=0x000000)
# dsInvite = await ctx.channel.create_invite()
embed.set_thumbnail(url=f"{ctx.author.avatar_url}")
embed.add_field(name="Author", value=f"<@!{ctx.author.id}>", inline=False)
embed.add_field(name="Channel", value=f"<#{ctx.channel.id}>", inline=False)
embed.add_field(name="Server", value=f"{ctx.guild}", inline=False)
# embed.add_field(name="Server invite", value=f"{dsInvite}", inline=False)
embed.add_field(
name="Message", value=f"{content}", inline=False)
await channel.send(embed=embed)```
This command actually works, if I do `>send_dm {user} hello!` the bot actually sends the user the entire details, but I want it to log every message gets sent after I run the command
I want it black
@bot.command()
async def dyt(self, ctx, *, url):
"""Plays from a url (almost anything youtube_dl supports)"""
async with ctx.typing():
player = await YTDLSource.from_url(url, loop=self.bot.loop)
ctx.voice_client.play(player, after=lambda e: print(f'Player error: {e}') if e else None)
await ctx.send(f'Now playing: {player.title}')```
Make a param like book and put it next to ctx
why is it indented
hm
By default the color is black
wym
¯_(ツ)_/¯
man I don't really care about color
I use dutils lol
yes 👍
^^^
dutils?
how do i fix this error
I dont know I dont use the example
maybe remove the *?
probably listen for on_message and log the messages
should I use Cog?
why ask us that?
i tried that
Cog.listener
thats on message in a cog
still does not work
I don't recommend but here ya go https://pypi.org/project/DiscordUtils/
oh
okay thanks i will check it
@boreal ravine
i used discord utils
install pynacl
pip install discord.py[voice]
requirment already satisfied
mhm now run the repl again
ok
I get the error but the code works fine. Error occurs when user leaves Temp VC (and the temp vc deletes itself)
Traceback (most recent call last):
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/client.py", line 343, in _run_event
await coro(*args, **kwargs)
File "main.py", line 782, in on_voice_state_update
if after.channel.id != None:
AttributeError: 'NoneType' object has no attribute 'id'```
Code below
```py
#Temp VC
@bot.event
async def on_voice_state_update(member, before, after):
with open("/home/runner/EBOT/info/temp_vc_ch_id.json", "r") as f:
file = json.load(f)
chnl_id = file[str(member.guild.id)]
chnl = int(chnl_id)
with open("/home/runner/EBOT/info/temp_vc_category_id.json", "r") as f2:
file2 = json.load(f2)
category_id = file2[str(member.guild.id)]
category = int(category_id)
if after.channel.id != None:
if after.channel.id == 868642724239278090:
guild = bot.get_guild(830981882890944512)
maincategory = discord.utils.get(
guild.categories, id=868642690777120789)
arrowvc= discord.utils.get(guild.channels, name='╰──┈┄┈┈┈────➣')
await arrowvc.delete()
channel2 = await guild.create_voice_channel(name=f" {member.display_name}'s VC", category=maincategory)
await channel2.set_permissions(guild.default_role, connect=False, view_channel=True)
await channel2.set_permissions(member, connect=True, stream=True, view_channel=True, use_voice_activation=True)
arrowvc2 = await guild.create_voice_channel(name="╰──┈┄┈┈┈────➣", category=maincategory)
await arrowvc2.set_permissions(guild.default_role, view_channel=True, connect=False)
await member.move_to(channel2)
def check(x, y, z):
return len(channel2.members) == 0
await bot.wait_for('voice_state_update', check=check)
await channel2.delete()
elif after.channel.id == chnl:
guild = bot.get_guild(member.guild.id)
maincategory = discord.utils.get(guild.categories, id=category)
channel2 = await guild.create_voice_channel(name=f" {member.display_name}'s VC", category=maincategory)
await channel2.set_permissions(guild.default_role, connect=False, view_channel=True)
await channel2.set_permissions(member, connect=True, stream=True, view_channel=True, use_voice_activation=True)
await member.move_to(channel2)
def check(x, y, z):
return len(channel2.members) == 0
await bot.wait_for('voice_state_update', check=check)
await channel2.delete()
Well, I'd guess the channel is no longer existing; so the after.channel object is simply None
Hello, how can I get the photo link inside the embed?
the same way as normal message
await message.edit(embed=Embed)
here Embed is the changed version
why are some commands in my cog working while some commands are commandnotFoundException
but it is not working
how i can get the message content from audit logs, i tried to do it but i couldn't, can someone help me with that please
pycord ig
somewhat related to d.py. Is pycord a good choice?
oh hahha
i dont want to rewrite tons of code so yeah i guess i can try pycord
add it 2 the embed
i did not get
add the button to the embed
why my embed is not editing
i am trying to edit my embed
but nothing is happening
anyone here plz hlp :/
if payload.message_id == msg_id:
if str(payload.emoji) == ':soyfonSugerencia:':
await payload.member.send('Envía tu sugerencia, recuerda que todas las sugerencias deben ser serias, en caso contrario podrás ser sancionado, muchas gracias. Escribe `cancelar` para salir.')
await mensaje_sugerencias.remove_reaction(':soyfonSugerencia:', payload.member)
def check(m):
return m.guild is not None and m.author == payload.member
message1 = await bot.wait_for('message', check=check)
if message1.content.lower() == 'cancelar':
await payload.member.send('Sugerencia cancelada.')
return
else:
with open("sugerencias.txt") as read_file:
executed = int(read_file.readline().strip())
titulo_sugerencia = f'Sugerencia #{executed}'
executed += 1
descripcion_sugerencia = message1.content
embed_sugerencia = discord.Embed(title=titulo_sugerencia, description=descripcion_sugerencia, color=0xb522ba)
embed_sugerencia.set_footer(text=payload.member, icon_url=payload.member.avatar_url)
mensaje_sugerencia = await canal_sugerencias.send(embed=embed_sugerencia)
await mensaje_sugerencia.add_reaction('\N{UPWARDS BLACK ARROW}\ufe0f')
await mensaje_sugerencia.add_reaction('\N{DOWNWARDS BLACK ARROW}\ufe0f')
await payload.member.send('Sugerencia enviada.')
with open("sugerencias.txt", "w") as write_file:
write_file.write(str(executed))
write_file.close()
why this embed is not editing embed have a timer but the timer is not running
Ok so this is supposed to get the person who reacted to the message, then remove the reaction and dm him, after he answers, the answer is sent to a channel
the problem is that when he says something before answering bot's dm
its sent the thing said on the server
no one replying :/
-1 < endtime < endtime + 1 seems invalid
and meaningless
endtime is always smaller than endtime + 1
but i am decreasing it in that loop so it will become less than 0 so it will stop
await await ctx.send(embed=embedStart).edit(embed=embedStart)
pycord is good
i want to edit
you are doing this man
this makes no sense
yes
Well it's actually meaningless
hmm
Because endtime isn't automatically modified
check this
but it worked in msg
man look at this
StartAnnounce is await ctx.send(embed=embedStart)
wht should i do?
so if you do await StartAnnounce
this will mean await await ctx.send(embed=embedStart)
ya that i understood
Initialize StartAnnounce again
ok so fix it
how?
that idk how to :/
I mean
ok so
embedStart
yes
how i can edit that embed?
no
edit embedStart's content first
endtime changes
:/
But embedStart doesn't change
yes
just the endtime
not the embed content
this is always the same
and please
You cant do this
like a timer
you will be rate limited
API abuse
if you change it every second you will get ratelimited
means i cannot add a timer in a embed?
!e
a = 1
b = f"{a}"
print(b)
a = 2
print(b)
@vagrant brook :white_check_mark: Your eval job has completed with return code 0.
001 | 1
002 | 1
sadly, no
ok
Make a 5 seconds delay
Is there a safe way of making a calculator?
how thats what i am asking
Learn how to do it?
Maybe don't use a 3rd party lib just use pycord or something?
no i dont
u are
how to put buttons in embed
pls
in decription
?
Add the button to the embed
then
It isn't that confusing
You have to use 2.0
Yes
just clear my doubt once
What
Is this a permissions issue or not? cs 2021-09-09T10:41:31.663374+00:00 app[worker.1]: 403 Forbidden (error code: 60003): Two factor is required for this operation 2021-09-09T10:41:31.806759+00:00 app[worker.1]: (<class 'discord.errors.Forbidden'>, Forbidden('403 Forbidden (error code: 60003): Two factor is required for this operation'), <traceback object at 0x7f9c90c10040>
anyone know how to make python bot for discord thats gonna count down from 99999999 to 0 lol
StartAnnounce = await ctx.send(f":loudspeaker: Giveaway has been Started by {ctx.author.mention} and Will End After {endtime} Seconds :partying_face:")
while -1 < endtime < endtime+1:
if GiveawayActive ==True:
await asyncio.sleep(0.7)
await StartAnnounce.edit(content=f":loudspeaker: Giveaway has been Started by {ctx.author.mention} and Will End After {endtime} Seconds :partying_face:")
endtime -= 1
should i use this ?
this is still wrong
but this is working perfect
StartAnnounce = await ctx.send(f":loudspeaker: Giveaway has been Started by {ctx.author.mention} and Will End After {endtime} Seconds :partying_face:")
await StartAnnounce
you are doing await await
oo
i = 99999999
while i > 1:
#send the messges
wht will happen by that more delay?
yea.. but.. im new to coding so idk what to put
😐
ye lol
StartAnnounce = ctx.send(f":loudspeaker: Giveaway has been Started by {ctx.author.mention} and Will End After {endtime} Seconds :partying_face:")
await StartAnnounce.edit(content=f":loudspeaker: Giveaway has been Started by {ctx.author.mention} and Will End After {endtime} Seconds :partying_face:")
this?
why do u think i came here
no no
:/
leave it like before
whats the problem with this ?
it is working
but u told i am using await await :/
np
PascalCase in python 
could someone check this
oops but i like that
@slate swan maybe use this rather than 3rd party libraries https://github.com/Pycord-Development/pycord
def check(reaction, user):
return user == ctx.author and str(reaction.emoji) in {"❎", "✅"}
onfirmation = await ctx.reply(f"You are about to ban {len(targets)} members. Do you want to add a reason for this ban? If **yes** react with ✅ and if **no** react with ❎")
await confirmation.add_reaction("✅")
await confirmation.add_reaction("❎")
try:
reaction, user = await self.bot.wait_for('reaction_add', timeout = 60.0, check = check)
if str(reaction.emoji) == "✅":
reason_event = await self.bot.wait_for('message')
reason = reason_event.content
else:
reason = "Unspecified"
except asyncio.TimeoutError:
confirmation.edit(content = "The time to add a reaction timed out so the defualt reason of `Unspecified` will be used.")
reason = "Unspecified"
confirmation.edit(content = f"You are about to ban {len(targets)} members. Do you want to select how mnay days of the members messages get deleted? If **yes** react with ✅ and if **no** react with ❎")
try:
reaction, user = await self.bot.wait_for('reaction_add', timeout = 60.0, check = check)
if str(reaction.emoji) == "✅":
days_event = await self.bot.wait_for('message')
delete_days = days_event.content
else:
reason = "Unspecified"
except asyncio.TimeoutError:
confirmation.edit(content = "The time to add a reaction timed out so the defualt of `1` will be used.")
delete_days = 1
for user in targets:
await user.ban(reason = reason, delete_message_days = delete_days)```So I have this command which partly works. The bot will listen for the first msg event (the reason) but for some reason once it has received a reason input it doesn't then edit the msg to ask about the delete days and i'm not sure why. I'm also not sure if I'm doing the right check.
yoo guys how would I go about making a bot that could collect pictures or text if the command is sent
I'm sure delete_message_days is supposed to be an int
Not a string
ThTs the same as while True
If they react with ❌ then just put none
oh should I wrap it up in a int(days_event.content). I wasn't sure if You can int a str
yes
No, I'm talking about if they react with ❌ then delete_message_days would raise an error
Or something idk
Lemme check
oh yeah i see where you mean now
client.command_prefix = commands.when_mentioned_or("!")
px = client.command_prefix
print(px)
``` Gives this: `<function when_mentioned_or.<locals>.inner at 0x7f5b68a341f0>` But I want it to just give `!`. Please help!
commands.when_mentioned_or("!") returns a function
do px()
and it will return the prefix
well then it's set correctly
because you're not assigning a string literal but a function
so it stores the function and not a literal string
that's how that works
also one thing you are doing incorrectly @slate swan
a discord.Client doesn't have a command_prefix, it doesn't have commands
so client.command_prefix should not be possible
bot.command_prefix should
they could have a Bot named client
thats what most people do
and that is a very wrong way to do python
no not really
It doesn't matter what your instance is as long as you know you won't define it again. I sometimes make my instance "bz" since it's short and I won't repeat it.
@dapper cobalt can u plz help me a bit
I can't help much since I'm on my phone on a yacht.
i just wanna know a way to do this
Do what?
i want to get the invite link of a server but how can i use this
inv = await ctx.channel.create_invite(max_uses=1)
like
inv = await guild.create_invite(max_uses=1)
the problem is that i have fetched the guild but i need to get a channel to make the invite but how can i get the channel
@hasty iron @dapper cobalt have you ever heard of consistent naming to make it clear to your future self and anyone else seeing your code what exactly is going on?
PEP 8
!pep 8
I use consistent naming when working with someone and when I ask for help I change my naming to something others can read.
@dapper cobalt ^
Bot is a subclass of Client so does it really matter
and most of the time you can see if they're using Bot or Client
discord.Guild doesn't have a create_invite method.
Choose a random channel from the guild's channels using random.choice() and try to create an invite for it.
oh and this discord is about helping people and teaching them things. Teaching them bad habbits is like the most counter productive thing
i mean i have got the guild but us there no way to get the link?
You can't create invites for guilds, only channels.
Create an invite for a randomly chosen channel in the guild's channels.
but how ?
random.choice(guild.text_channels)
for channel in guild.channel:
random.choose(channel)
will it work?
Oh you don't even know how to use random. Well I suggest you learn it first.
i dont mean that i am trying to do something else
channel = random.choice(guild.text_channels)
invite = await channel.create_invite()
for x in range(500)
thanks actually i made it in a different way
That's considered spam tho, and against the ToS.
Well we can't really help you according to rule 5.
@bot.command()
async def giveaway(ctx, *args):
output = ''
embed = discord.Embed(
title="  Giveaway Donations ",
description=output,
color=0xff0000
)
embed.add_field(name="**Time**", value=f"{args[0]}")
embed.add_field(name="**Requirements**:", value=f"{args[1]}", inline = "False")
embed.add_field(name="**Winners**:", value=f"{args[2]}", inline = "False")
embed.add_field(name="**Price**:", value=f"{args[3]}", inline = "False")
embed.add_field(name="**Message**:", value=f"{args[4]}", inline = "False")
await ctx.send(embed=embed)
await ctx.message.delete()
``` so the bot takes every word after sapce as a new arg i want to make a symbol so that the bot only takes a arg after that symbol
how do i do that ?
Hi so I have this command here: https://srcb.in/a2g8FdweCt which works for the most part however this msg edit py confirmation.edit(content = f"You are about to ban {len(targets)} members.\n\nDo you want to select how mnay days of the members messages get deleted? **yes** = ✅ and **no** = ❎")doesn't seem to be happening despite the bot waiting for the reactions and taking the response to be used later
something like --time whatever?
and stuff like that
you didnt await the edits
s!giveaway hello/bye/ok/thank
and the bot takes hello bye....so on as diff args
@client.command(aliases=["nick"])
@has_permissions(manage_nicknames=True)
async def nickname(ctx, member: commands.MemberConverter, nickname):
await member.edit(nick=nickname)
await ctx.reply(f"\u2705 Successfully edited the nickname to `{nickname}`")```
what's wrong?
Use typehint discord.Member for member arg
still
Any error?
!d discord.Permissions
class discord.Permissions(permissions=0, **kwargs)```
Wraps up the Discord permission value.
The properties provided are two way. You can set and retrieve individual bits using the properties as if they were regular bools. This allows you to edit permissions.
Changed in version 1.3: You can now use keyword arguments to initialize [`Permissions`](https://discordpy.readthedocs.io/en/stable/api.html#discord.Permissions "discord.Permissions") similar to [`update()`](https://discordpy.readthedocs.io/en/stable/api.html#discord.Permissions.update "discord.Permissions.update").
is this the correct way to delete a msg that the bot was waiting on?py try: reaction, user = await self.bot.wait_for('reaction_add', timeout = 60.0, check = check) if str(reaction.emoji) == "✅": reason_event = await self.bot.wait_for('message') reason = reason_event.content await confirmation.remove_reaction("✅", ctx.author) await reason_event.delete(5)bc I got this errorpy TypeError: delete() takes 1 positional argument but 2 were given
oof
help
how i can delete the command after use
likei used
>kick somebody
than how i can delete it
after a delay
await ctx.message.delete()```
I was close
this is deleting idk which msg :/
The authors
time.sleep(2)
ctx.message.delete()
the ctx (or contnext msg) is the msg with the command
await ctx.send(delete_after=2)
this is deleting the msg
also
which i edited
you don't need to sleep it, you can just add delay=float to the await
@client.command(aliases=["nick"])
@has_permissions(manage_nicknames=True)
async def nickname(ctx, member: commands.MemberConverter, nickname):
await member.edit(nick=nickname)
await ctx.reply(f"\u2705 Successfully edited the nickname to `{nickname}`")```
help it's not working
someone explain how do i like
when i send !cd it starts counting down how do i delete the "!cd"
^
o ok thanks
^
how i can use that??
await ctx.send("hi",delete_after=2)
```?
help pls
Just use a time.sleep lol
Indeed
No
when i do it it wont open
??
Breh
I’m not wrong it works fine
aa imma confused :/
k
@client.command(aliases=["nick"])
@has_permissions(manage_nicknames=True)
async def nickname(ctx, member: commands.MemberConverter, nickname):
await member.edit(nick=nickname)
await ctx.reply(f"\u2705 Successfully edited the nickname to `{nickname}`")```
helpppppppppppppppppppp
@client.command()
async def join(ctx):
channel = ctx.author.voice.channel
await channel.connect()
@client.command()
async def leave(ctx):
await ctx.voice_client.disconnect()
any idea why this isn't working? (no errors)
it works fine but wont delete
@client.command(aliases=["connect", "come"])
async def join(ctx):
try:
channel = ctx.author.voice.channel
embed = discord.Embed(color=0x000000)
embed.add_field(
name="\u2705 Success!", value=f"Successfully connected to `{channel}`.", inline=False)
await channel.connect()
await ctx.guild.change_voice_state(channel=channel, self_mute=False, self_deaf=True)
await ctx.send(embed=embed)
except:
embed = discord.Embed(color=0x000000)
embed.add_field(
name="\u26d4 Error!", value="An error occurred. [Maybe you're not connected to a voice channel]", inline=False)
await ctx.send(embed=embed)
@client.command(aliases=["disconnect", "fuckoff"])
async def leave(ctx):
try:
channel = ctx.voice_client.channel
await ctx.voice_client.disconnect()
embed = discord.Embed(color=0x000000)
embed.add_field(
name="\u2705 Success!", value=f"Successfully disconnected from `{channel}`.", inline=False)
await ctx.send(embed=embed)
except:
embed = discord.Embed(color=0x000000)
embed.add_field(
name="\u26d4 Error!", value="An error occurred. [Maybe you're not connected to a voice channel]", inline=False)
await ctx.send(embed=embed)```
get this from my bot
and how i can delete that
idk its not working
ctx.message.delete("!cd")
requirement already satsfied...
chill
sorry for caps
nope
it works fine for me
let me give it an ID instead of ctx.author.voice.channel
it is
@client.command(aliases=["nick"])
@has_permissions(manage_nicknames=True)
async def nickname(ctx, member: commands.MemberConverter, nickname):
await member.edit(nick=nickname)
await ctx.reply(f"\u2705 Successfully edited the nickname to `{nickname}`")```
helpppppppppppppppppppp
it's not commands.MemberConverter
it's the same
it's just discord.Member as the typehint and the library internally calls the converter
commands.MemberConverter is more useful
it detects an user by their id, username#discriminator and ping
discord.Member is a typehint
and as i just said, the library interally calls the converter
I did this and it still doesn't work...
@client.command(aliases=["connect", "come"])
async def join(ctx):
try:
guild = client.get_guild(756504534897000528)
channel = guild.get_channel(879332800656986152)
embed = discord.Embed(color=0x000000)
embed.add_field(
name="\u2705 Success!", value=f"Successfully connected to `{channel}`.", inline=False)
await channel.connect()
await ctx.guild.change_voice_state(channel=channel, self_mute=False, self_deaf=True)
await ctx.send(embed=embed)
except:
embed = discord.Embed(color=0x000000)
embed.add_field(
name="\u26d4 Error!", value="An error occurred. [Maybe you're not connected to a voice channel]", inline=False)
await ctx.send(embed=embed)
Idk man
Urgh
Lol, its the same thing
type hinting to discord.Member does just that
I did and still doesn't work
code?
not working
!d discord.ext.commands.has_permissions
discord.ext.commands.has_permissions(**perms)```
A [`check()`](https://discordpy.readthedocs.io/en/stable/ext/commands/api.html#discord.ext.commands.check "discord.ext.commands.check") that is added that checks if the member has all of the permissions necessary.
Note that this check operates on the current channel permissions, not the guild wide permissions.
The permissions passed in must be exactly like the properties shown under [`discord.Permissions`](https://discordpy.readthedocs.io/en/stable/api.html#discord.Permissions "discord.Permissions").
This check raises a special exception, [`MissingPermissions`](https://discordpy.readthedocs.io/en/stable/ext/commands/api.html#discord.ext.commands.MissingPermissions "discord.ext.commands.MissingPermissions") that is inherited from [`CheckFailure`](https://discordpy.readthedocs.io/en/stable/ext/commands/api.html#discord.ext.commands.CheckFailure "discord.ext.commands.CheckFailure").
