#discord-bots
1 messages · Page 510 of 1
what a cheap host you can recommend?
I cant find a single example of anyone using on_reaction_remove on the internet or Stack overflow. Does anyone have a working example of using wait_for to get the user which removed a reaction?
class Dropdown(discord.ui.Select):
def __init__(self):
options = [
discord.SelectOption(label='Red', description='Your favourite colour is red', emoji='🟥'),
discord.SelectOption(label='Green', description='Your favourite colour is green', emoji='🟩'),
discord.SelectOption(label='Blue', description='Your favourite colour is blue', emoji='🟦')
]
super().__init__(placeholder='Choose your favourite colour...', min_values=1, max_values=1, options=options)
async def callback(self, interaction: discord.Interaction):
await interaction.response.send_message(f'Your favourite colour is {self.values[0]}', ephemeral=True)
class DropdownView(discord.ui.View):
def __init__(self, ctx):
super().__init__(timeout=5)
self.ctx = ctx
self.add_item(Dropdown())
async def interaction_check(self, interaction: discord.Interaction) -> bool:
if interaction.user.id != self.ctx.author.id:
await interaction.response.send_message(
embed=discord.Embed(description=f"{utily.error} Sorry, you can't use this! This interaction belongs to {self.ctx.author.mention}.",color=0xffffff), ephemeral=True)
return False
return True
async def on_timeout(self) -> None:
self.children[0].disabled = True
self.children[0].label = 'Closed'
await self.message.edit(view=self)
@commands.command()
async def drop(self, ctx):
await ctx.send('Pick your favourite colour:', view=DropdownView(ctx))
```the timeout disable is not working
Yeah, message.author
@client.event
async def on_voice_state_update(member,before,after):
if member.bot:
return
if before.channel and after.channel:
if after.self_video == True:
return
else:
channel1 = discord.utils.get(member.guild.channels, id = 885099421006725150)
await channel1.send("Please enable your cam")
await asyncio.sleep(10)
await member.move_to(channel=None)
I am trying to achieve this :- If someone doesn't turn on cam in VC then bot should send message if they turn on cam after the bot sends the message then the bot shouldn't disconnect it, if the user doesn't turn on cam then the bot should someone that user
But the issue in my code is that you can only turn on your cam when you enter a VC (by default the cam is off) so even if the user turns on their cam after entering the VC the bot is disconnecting them
How do you fix this?
Ping on reply
wait a abit and if they open their cam the dont move em
or disconnect them
@sick talon
Can You Ping Member By msg.channel.send() ? And How
couple ways
get the member then then mention em like this ```py
member = bot.get_member(their id)
await msg.channel.send(member.mention)
or just straight up use their id(sometimes it doesnt ping em) ```py
await msf.channel.send("<@their id>")
yeah I know that
about I tried it didn't work
<> Has Special Meaning?
Ah.. Thx
can we add buttons with discord.py yet ?
code?
its a bit of a large code
rapptz alr added it before he archived it
can you send the part of the error?
yup
@commands.command(name='play')
async def _play(self, ctx: commands.Context, *, search: str):
if not ctx.voice_state.voice:
await ctx.invoke(self._join)
async with ctx.typing():
try:
source = await YTDLSource.create_source(ctx, search, loop=self.bot.loop)
except YTDLError as e:
await ctx.send('An error occurred while processing this request: {}'.format(str(e)))
else:
song = Song(source)
await ctx.voice_state.songs.put(song)
await ctx.send('Enqueued {}'.format(str(source)))
@rustic onyx download a ffmpeg.exe and keep it in your folder
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)
what does Command raised an exception: UnboundLocalError: local variable 'rctn' referenced before assignment
Exception ignored in: <function _ProactorBasePipeTransport.del at 0x0000027CBE074670>
means?
ah sed
Shhh
no
Imagine you never saw it
but i saw it too 
im gonna see it
Btw, should FFmPeg give a .zip or a source code or directly a .exe
.
zip containing ffmpeg.exe
and other files
Cause there are like 20 .zip hahha
extract them then add the path to your environmental variables
help!
\n
\n
Thank u
np
do i put it within the string?
yes
what does Command raised an exception: UnboundLocalError: local variable 'rctn' referenced before assignment
Exception ignored in: <function _ProactorBasePipeTransport.del at 0x0000027CBE074670>
like this?
!e
print("new\nline")
@jade jolt :white_check_mark: Your eval job has completed with return code 0.
001 | new
002 | line
like what i did
thanks
its \ not /
ohhh
@commands.command()
async def getchannel(self, ctx, category:discord.CategoryChannel):
guild = self.bot.get_guild(722342386164039793)
categoryid = discord.utils.get(guild.categories, id = category.id)
if categoryid in guild:
for channel in categoryid:
await ctx.send(", ".join(channel))```
trying to get all the channels in a category with id , this doesnt work
`?getchannel 724060412105981980` throws an error - `ChannelNotFound: Channel "724060412105981980" not found`.
guys is thhere a way to make an embed footer's name and value in the same line?
because im sure that inline =True wont do it
Hey @void ravine!
It looks like you tried to attach a Python file - please use a code-pasting service such as https://paste.pythondiscord.com
i mean fields
i have a tasks.loop in a cog and before_loop for it but it sends an error saying "contestloop isnt defined", thats the loops name btw, what do i do?
footer? footer only has name
fields
then no
then how can i add a comma after every 3 digits?
like what if i want it to display 1,000,000 and not 1000000?
!e
_50k = "{:,}".format(50000)
print(_50k)
@dapper cobalt :white_check_mark: Your eval job has completed with return code 0.
50,000
!e
_500k = "{:,}".format(500000)
print(_500k)
@dapper cobalt :white_check_mark: Your eval job has completed with return code 0.
500,000
so how can i do it for random numbers?
You can read this: https://pythonguides.com/python-format-number-with-commas
Pass the int into the format function.
okk
TypeError: 'CategoryChannel' object is not iterable what does this mean?
for channel in discord.CategoryChannel-instance
would throw this error
or any code where you use discord.CategoryChannel as a list
figured ty
How do we check permissions for a command
permissions of the user or the bot?
for the user:
!d discord.ext.commands.has_permissions
@discord.ext.commands.has_permissions(**perms)```
A [`check()`](https://discordpy.readthedocs.io/en/master/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/master/api.html#discord.Permissions "discord.Permissions").
This check raises a special exception, [`MissingPermissions`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.MissingPermissions "discord.ext.commands.MissingPermissions") that is inherited from [`CheckFailure`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.CheckFailure "discord.ext.commands.CheckFailure").
👍
i want to get msgs from a channel and send to a different channel, how can i do it?
@client.command()
@command.has_permissions(ban_members = True, kick_members = true)
async def kick(ctx, member: discord.Member, *, reason=None):
print("hmm")
await member.kick(reason=reason)
await ctx.send('A member has been Kicked')
How do I check ban and kick permissions here
@commands.has_permissions(ban_members = True, kick_members = true)
But I think I get a error then
@waxen granite
what error?
commands*
Ok I will fix it it's easy thanks
!d os.chdir
os.chdir(path)```
Change the current working directory to *path*.
This function can support [specifying a file descriptor](https://docs.python.org/3.10/library/os.html#path-fd). The descriptor must refer to an opened directory, not an open file.
This function can raise [`OSError`](https://docs.python.org/3.10/library/exceptions.html#OSError "OSError") and subclasses such as [`FileNotFoundError`](https://docs.python.org/3.10/library/exceptions.html#FileNotFoundError "FileNotFoundError"), [`PermissionError`](https://docs.python.org/3.10/library/exceptions.html#PermissionError "PermissionError"), and [`NotADirectoryError`](https://docs.python.org/3.10/library/exceptions.html#NotADirectoryError "NotADirectoryError").
Raises an [auditing event](https://docs.python.org/3.10/library/sys.html#auditing) `os.chdir` with argument `path`.
New in version 3.3: Added support for specifying *path* as a file descriptor on some platforms.
Changed in version 3.6: Accepts a [path-like object](https://docs.python.org/3.10/glossary.html#term-path-like-object).
i need help, im watching a tutorial and going through the steps it shows and i ran the code at the end and it says theres a problem with this, the error that pops up says the file is not found:
im attempting to learn how to make an economy bot
hey bois, my bot got a system of another prefix in every server(like every admin can change it), and i want to make a dm command. how do i do it?
def get_prefix(bot, message):
with open('prefixes.json', 'r') as f:
prefixes = json.load(f)
return prefixes[str(message.guild.id)]
command_prefix=get_prefix
any1?
idk, im waiting for help about my thing, i have no idea how to fix urs
Do you guys know how to make bot send message the moment it turns on?
did you import os?
yes
use on_ready event
Ok! Let me try!
full code:
import discord
from discord.ext import commands
import asyncio
import os
import random
import json
os.chdir("C:\\Users\\swast\\Desktop\\Economy Manager")
bot = commands.Bot(command_prefix = '$')
@bot.event
async def on_ready():
print ("ready")
@bot.command()
async def balance(ctx):
a = await open_account(ctx.author)
users = await get_bank_data()
wallet_amt = users[str(users.id)]["wallet"]
bank_amt = users[str(users.id)]["bank"]
em = discord.Embed(title = f"{ctx.author.name}'s balance", color = 0xffa622)
em.add_field(Name = "Wallet",value = wallet_amt)
em.add_field(name = "wallet balance", value = wallet_amt)
em.add_field(name = "wallet balance", value = bank_amt)
await ctx.send(embed = em)
@bot.command()
async def beg(ctx):
await open_account(ctx.author)
user = ctx.author
users = await get_bank_data()
earnings = random.randrange(101)
await ctx.send(f'Someone gave you {earnings} coins!')
users[str(users.id)]["wallet"] += earnings
with open("mainbank.json", "w") as f:
users = json.load(f)
async def open_account(user):
users = await get_bank_data()
if str(user.id) in users:
return False
else:
users[str(user.id)]
users[str(user.id)]["wallet"] = 0
users[str(user.id)]["bank"] = 0
with open("mainbank.json", "w") as f:
users = json.load(f)
json.dump(users,f)
return True
async def get_bank_data():
with open("mainbank.json", "r") as f:
users = json.load(f)
return users
bot.run(os.getenv('Token'))
y r u using os.chdir if the mainbank.json is in the same folder as the py file?
idk what im doing, im trying to follow a tutorial so i can take pieces of the code and figure out how they work
im just tired of seeing this same darn code for the economy system
?
remove the os.chdir line
replace w what?
just remove it
the whole os.chdir("C:\\Users\\swast\\Desktop\\Economy Manager")?
Hey I want to use the commands extension of discord.py but when I look for the event "on_message" the commands no longer work, how can I get it to check if the message is a command before the on_message event?
or pycord ig
dont use on_message, use bot.command
well I'm looking for any message except $lfg in a specific channel
idk how to do that
same
remove the whole os.chdir("C:\\Users\\swast\\Desktop\\Economy Manager")?
yes
ok
!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/master/api.html#discord.on_message "discord.on_message") event. If you choose to override the [`on_message()`](https://discordpy.readthedocs.io/en/master/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/master/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/master/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/master/ext/commands/api.html#discord.ext.commands.Bot.get_context "discord.ext.commands.Bot.get_context") or [`invoke()`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.Bot.invoke "discord.ext.commands.Bot.invoke") if so.
what
now what?
should work
so I process_comands in the event of a message?
Traceback (most recent call last):
File "main.py", line 69, in <module>
bot.run(os.getenv('Token'))
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/client.py", line 723, in run
return future.result()
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/client.py", line 702, in runner
await self.start(*args, **kwargs)
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/client.py", line 665, in start
await self.login(*args, bot=bot)
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/client.py", line 511, in login
await self.http.static_login(token.strip(), bot=bot)
AttributeError: 'NoneType' object has no attribute 'strip'
my error
thanks, love you
np
Just put
bot.run('token')
In the last line
I didnt see the full error cause im on my phone
can someone help me with this function
@ client.event async def on_ready(): client.get_channel("xxxxxxxxxxxx) await channel.send("I'm on!")
save the channel into a variable
and we can't do anything with the id, you don't have to hide it
also, sending stuff in on_ready is scuffed
So what would you recommend to use
!d discord.ext.commands.Bot.wait_until_ready
await wait_until_ready()```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).
Waits until the client’s internal cache is all ready.
sry, i had to go for a bit
ye that
I want it to send message once it's on
or every time I turn it on?
well not multiple times a day, but it's randomly gonna reconnect
gotcha
that didnt help
@quaint axle.event
async def on_ready():
client.get_channel("893524345576644679")
await wait_until_ready()
and how do I print message>
actually i just forgot to make 'Token' a variable
how to check if a user's role is higher than bot's role ?
and that creates error
await channel.send
why did you remove that
await client.wait_until_ready()
channel = client.get_channel("893524345576644679")
await channel.send("hello")```
in on_ready
await channel.send("hello")
AttributeError: 'NoneType' object has no attribute 'send'
oh shit
it's not supposed to be a string
await client.wait_until_ready()
channel = client.get_channel(893524345576644679)
await channel.send("hello")```
that's on me

Is there a way to send a message once it's going off?
I don't know nothing about that, maybe somebody else
How would that even be possible?
but like based on logic
You would probably need another bot
if the bot's offline, it can't send a message until it's online again
Yeah
You can make another bot and check when your main bot's status changes to discord.Status.offline.
!d discord.on_member_update
discord.on_member_update(before, after)```
Called when a [`Member`](https://discordpy.readthedocs.io/en/master/api.html#discord.Member "discord.Member") updates their profile.
This is called when one or more of the following things change:
• nickname
• roles
• pending...
which basically would be "I'm online" instead of "Disconnected"
if before.status == "online" and after.status == "offline":
channel = client.get_channel(..)
await channel.send("Bot has gone offline!")
has someone here ever successfully made an economy bot using python before?
if so pls DM me i need help bad
there's no other reason for a bot to disconnect, other than internet issues
if it's working fine
then where does the other bot run?

I did.
can u help me?
But not sure if it's the type of economy you would expect, I made it differently.
this channel is made for that
More like dank memer's.
Logically you could do a bot that spots if member is on/off
yes
That's what I said.
@dapper cobalt can u DM me?
Why?
bcs i need help w economy bot
cool
and no one else has said anything
why? im failing miserably
What is it's purpose?
What would you like it to do?
do you know what an economy bot is?
you haven't written it, have u
how to check if a user's role is higher than bot's role?
No
gain money, buy things, flex on others
what do you mean?
now I know 🙂
bot currency, not real money
yes
i see that...
You can ask here.
What is it
?
the problem
bitchass wym ?
hey
gtfo im not helping
chill
We will help you to progress with your issues, we won't guide you on how to make it.
but i dont know what issues i have bcs i dont understand it
you don't understand what
how the stupid economy system in python works
that's not a thing in python....
if its stupid why do you want it
that's a thing you write in python
you store all of the data in a database
Do you know how to use a database?
then get it once someone uses a command
json file
no
no
lol
bro literally go do school
Papa Nik chill
bcs im smart i finished all my school work for today, k?
!mute 737960337671979008 1d Unacceptable behaviour. Please abide by our #code-of-conduct.
:incoming_envelope: :ok_hand: applied mute to @unreal silo until <t:1633192483:f> (23 hours and 59 minutes).
ooo
:p
how do i get the message.content if the message is an embed?
eplain
message.embeds
do you want to get the title or the description?
Will return the embed objects
In a list
whatever there is in the embed
yep, that would work
message.embeds[0]
How can I make custom rule showing commands for different servers
you'd have to use two variables
here is my code
if message.channel == 808402161305911326:
embeds = message.embeds
for embed in embeds:
embed1 = discord.Embed(description = embed.to_dict(), timestamp = datetime.datetime.utcnow())
await sac.send(embed = embed1)```
save message.embeds[0].title or message.embeds[0].description
yeah that's better lol
Then you can simply get the attributes of an embed object
!d discord.Embed
class discord.Embed(*, colour=Embed.Empty, color=Embed.Empty, title=Embed.Empty, type='rich', url=Embed.Empty, description=Embed.Empty, timestamp=None)```
Represents a Discord embed.
len(x) Returns the total size of the embed. Useful for checking if it’s within the 6000 character limit.
bool(b) Returns whether the embed has any data set.
New in version 2.0.
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/master/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.
All of them are shown here if you need a specific one
my code doesnt work
Anyone
messages barely have two embeds
mine do
Hey! Searching for any good library for discord bot coding! Discord.py and other forks aren’t that useful, since there’s no updates and new features. Ping me, if there’s one
disthon ;)
!pypi disnake
I’ve check it
It’s fork of discord.py, but it’s with slashes… probably I’ll use it
That's not even on pypi
ok?
Grounds are still a bit shaky on what to go to instead of Discord.py. Some you may want to look at include:
- Nextcord, Pycord, Disnake are probably the more well known forks, which I believe you want to avoid, although the latter contains most of what you want.
- There's also Hikari which is basically it's own thing. Another one I've been following is Krema, which seems decent.
- ||and i'll also take the opportunity to plug my own, Pycordia||
Hey is there a way for a bot to publish messages in an announcements channel?
I’ll check Hikari, it seems to be the thing I’m searching for
is there a way to check what channels my bot can see in a guild?
!d discord.Guild.channels
property channels: List[GuildChannel]```
A list of channels that belongs to this guild.
this property returns the channels only what the bot has perm view_channels = true?
yeah iirc
how do i test if a command is on cooldown?
well itsends all the channels in a guild
hmm
commands.cooldown
maybe you can filter the channels and check if the bot has permissions to view it
@Bot.command()
@commands.cooldown(rate=1, per=5)
async def test(ctx=None):
await ctx.send('test')
if commands.cooldown():
await ctx.send('Command is on cooldown, please wait.')
?
if commands.cooldown(): await ctx.send('Command is on cooldown, please wait.') this thing you have to do it in on_command_error
seperate event
anyone else having this issue with pip
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProtocolError('Connection aborted.', PermissionError(13, 'Permission denied'))': /simple/pip/
idk how that works :/
@bot.event async def on_command_error(ctx, error):
How hard is it to make a bot to remove a role simultaneously with another?
For example, to make members automatically lose a role when they lose the server booster role?
thaat works but it sends the thing right after i use the command even if it isnt on cooldown
remove the line from the command
make a botevent for on_command_error
how to get the username of who reacted the message
and use isinstance for commands.CommandOnCooldown
thx
anyone know how to force put a user on commands.cooldown
how to check if a user react ?
how do i make it so it only happens if the command is on cooldown? if i try to use a command that doesnt exist it says its on cooldown
!d discord.Message.reactions
Reactions to a message. Reactions can be either custom emoji or standard unicode emoji.
okkkkk
what ?
show code
how to return the username of the person who reacted to the message
bot event for on_reaction_add
In the event or...?
was meant to use this
reaction, user = await bot.wait_for('reaction_add')
but looks like using the event gives me more easier options
category = guild.categories
for cat in category:
await ctx.send(cat.name)
for channel in cat.channels:
if self.bot.has_permissions(view_channel = True):```
error `'Bot' object has no attribute 'has_permissions' `
it stops the code asynchronously until after the wait_for. If you do print('hi') after reaction, user = await bot.wait_for('reaction_add') it will only print 'hi' after someone has reacted
do you mean if ctx.me.has_permissions?
maybe
and how to return their usernames ?
yeah
oh
kk
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.
also it stops after 1 person reacted, should i put it in a while loop ?
like what if i want the member to be optional
and still be called if variable isnt set
member:discord.Member=None
okk
type hint the parameter with typing.Opional and give it a default value
if not member: member = ctx.author
can do
depends your python version
do you want it to recieve reactions forever?
'Member' object has no attribute 'has_permissions'
yes
then put it in a while loop
guys, why doesnt this work?
@client.command()
async def customrole(ctx, rolename, hexcode, member: discord.Member=None):
if member is None:
member = ctx.message.author
await ctx.guild.create_role(name=rolename, color=discord.Color(hexcode), permissions=discord.Permissions(permissions=None))
role = discord.utils.get(ctx.guild.roles, name=rolename)
await member.add_roles(role)
await ctx.send("Successful")
reaction, user = await bot.wait_for('reaction_add')
while True:
#code
if x:
break
reaction, user = await bot.wait_for('reaction_add')```
or you can use a walrus
anyone help me?
with?
a) errors b) what are you trying to do c) the indenting looks weird
importing a specifiq version of google trans in repl.it
i did pip install googletrans==3.1.0a0
@manic wing'Member' object has no attribute 'has_permissions'
googletrans is shit
do you mean guild_permissions
!d discord.Member.guild_permissions
property guild_permissions: discord.permissions.Permissions```
Returns the member’s guild permissions.
This only takes into consideration the guild permissions and not most of the implied permissions or any of the channel permission overwrites. For 100% accurate permission calculation, please use [`abc.GuildChannel.permissions_for()`](https://discordpy.readthedocs.io/en/master/api.html#discord.abc.GuildChannel.permissions_for "discord.abc.GuildChannel.permissions_for").
This does take into consideration guild ownership and the administrator implication.
ctx.me.guild_permissions
no error, when i use try and except statements, it says, it expected int type instead of str
i am just trying to get all the channels in aguild which the bot can see
eh
or have perm view-channels as True
@commands.has_permission(permission here)
thn how can i make a translator?
do hexcode: int
ah okay sure
not command
the bot perm
@commands.bot_has_permissions then
or read the docs otherwise
it is not a command oof
🤦♂️
!d discord.TextChannel.permissions_for
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...
😂
so if ctx.channel.permissions_for(ctx.me, 'read_messages')
can anyone help me!!
hexcode is an int with base 16
its called hex
so you would do
!e print(int('ffff', 16))
@manic wing :white_check_mark: Your eval job has completed with return code 0.
65535
ah okay
why no one help me?
@manic wing no error and no role assigning
@client.command()
async def customrole(ctx, rolename, hexcode, member: discord.Member=None):
if member is None:
member = ctx.message.author
try:
await ctx.guild.create_role(name=rolename, color=discord.Color(int(hexcode)), permissions=discord.Permissions(permissions=None))
role = discord.utils.get(ctx.guild.roles, name=rolename)
await member.add_roles(role)
await ctx.send("Successful")
except Exception as e:
print(e)
ask 🥲
it's not working properly, it stop after one or two, and it makes (it's supposed to make a ticket channel) 3 times
typehint hexcode as discord.Color and pass it in directly like color=hexcode
want help in importing a specifiq version of google trans in repl.it
i did pip install googletrans==3.1.0a0
but everytime the repl refreshes the version goes back to 2.4.0
oh, thankuu
i see, that never happened with me tho....
maybe update it using pip?
so?
but it always does the same after a refresh
send the code
same happens with me for a library extension too
i want a solution
anyone?
sorry, but idk
@hasty iron its not even creating the role
@client.command()
async def customrole(ctx, rolename, hexcode):
try:
await ctx.guild.create_role(name=rolename, color=hexcode,
permissions=discord.Permissions(permissions=None))
await ctx.send("Successful")
except Exception as e:
print(e)
you didnt even typehint it
oh my bad
is there a way to check if the user of a specific command has a certain id?
yesh
how?
#bot-commands
you can just do ctx.author btw
yeah
well i think there would be await instead of ctx
where?
so ctx.author.id ??????
yes
line 5
Yeah I was telling you. Not him
huh
wha....
That you could can do ctx.author instead of ctx.message.author
yes try that
line 5
in the create role?
await guild.create_role
hmm
What ????
do u know what asynchronous functions are, my friend 😂
no offence
in my mute cmd i used that await guild to create a muted role
No offense but if you don't know how to help don't
yep
wha...
yupp
you probably made another lib for async programming
I am seriously confused 🥲 , how can asynchronous function keyword have any relation with discord py
try await guild
with no dots in between
guild will remain undefined
discord.py is an async lib
yup
don't help in something you don't know
i meant like....the other way 'round
?
guild = ctx.guild```
Ummm..i meant how can await be used to create something
forgot to say
He doesn’t need to do that
using discord.py 🤓
Doing ctx.guild literally does the same thing
i am doing the same thing ig
@client.command()
async def customrole(ctx, rolename, hexcode, member: discord.Member=None):
if member is None:
member = ctx.message.author
try:
await ctx.guild.create_role(name=rolename, color=int(hexcode), permissions=discord.Permissions(permissions=None))
await doesnt create something
it just waits till a coroutine finishes executing
await is used to run coroutine
yeah, riad was giving me solution to use await instead of ctx 🥲
you can not do await and still run an async functionn
What is the new message intent thing
anyways if i mention a type hint, it gives an error @hasty iron
!e ```py
async def foo():
return 1
try:
coro = foo()
coro.send(None)
except StopIteration as exc:
print(exc.value)
@hasty iron :white_check_mark: Your eval job has completed with return code 0.
1
it's getting privileged
@bot.command()
@commands.has_permissions(administrator=True)
async def mute(ctx, member: discord.Member, *, reason=None):
guild = ctx.guild
mutedrole = discord.utils.get(guild.roles, name = "Muted")
if not mutedrole:
mutedrole = await guild.create_role(name = "Muted")
for channel in guild.channels:
await channel.set_permissions(mutedrole, speak=False,send_messages=False,read_message_history=True,read_messeges=False)
await member.add_roles(mutedrole, reason=reason)
await ctx.send(f"Muted {member.mention} for reason {reason}")
await member.send(f"You were Muted in the server {guild.name} for {reason}")
@bot.command()
@commands.has_permissions(administrator=True)
async def unmute(ctx, member: discord.Member):
guild = ctx.guild
mutedrole = discord.utils.get(guild.roles, name = "Muted")
await member.remove_roles(mutedrole)
await ctx.send(f"Unmuted {member.mention}")
await member.send(f"You were Unmuted in the server {guild.name}")```
can you send the code and the error with the typehint?
i used this to create a muted role
SURE, JUST A MINUTE
@ client.command(pass_context = True) async def clear(ctx, number): mgs = [] #Empty list to put all the messages in the log number = int(number) #Converting the amount of messages to delete to an integer async for x in client.logs_from(ctx.message.channel, limit = number): mgs.append(x) await client.delete_messages(mgs)
raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: AttributeError: 'Bot' object has no attribute 'logs_from'
Why am I getting this error?
self explanatory
because old code
code??
@client.command()
async def customrole(ctx, rolename, hexcode:int, member: discord.Member=None):
if member is None:
member = ctx.message.author
try:
await ctx.guild.create_role(name=rolename, color=hexcode, permissions=discord.Permissions(permissions=None))
role = discord.utils.get(ctx.guild.roles, name=rolename)
await member.add_roles(role)
await ctx.send("Successful")
except Exception as e:
print(e)
oh...
like this?
@client.command()
async def customrole(ctx, rolename, hexcode, member: discord.Member=None):
try:
await ctx.guild.create_role(name=rolename, color=discord.Color(hexcode), permissions=discord.Permissions(permissions=None))
imma cry
replace it with int in hexcode?
again, typehint hexcode as discord.Color
oh
if you dont know what typehint is, its doing param: type
yesh
@client.command()
async def customrole(ctx, rolename, hexcode: discord.Color, member: discord.Member=None):
try:
await ctx.guild.create_role(name=rolename, color=hexcode, permissions=discord.Permissions(permissions=None))
You can’t pass in the hex code like that
umm...
discord.Color only accepts ints
oh
0xfcb103
??
!d discord.ext.commands.ColourConverter
class discord.ext.commands.ColourConverter(*args, **kwargs)```
Converts to a [`Colour`](https://discordpy.readthedocs.io/en/master/api.html#discord.Colour "discord.Colour").
Changed in version 1.5: Add an alias named ColorConverter
The following formats are accepted...
read what it accepts
is this okay 🥲 ```py
@client.command()
async def customrole(ctx, rolename, hexcode: discord.Color, member: discord.Member=None):
try:
await ctx.guild.create_role(name=rolename, color=hexcode, permissions=discord.Permissions(permissions=None))
:O
tias
@bot.command()
@commands.has_permissions(ban_members=True)
async def st(ctx):
message = await ctx.channel.send(embed=discord.Embed(description='To enter the tournament click the button below.'))
await message.add_reaction('👍')
guild = ctx.guild
overwrites = {guild.default_role: discord.PermissionOverwrite(read_messages=False), guild.me: discord.PermissionOverwrite(read_messages=True)}
def check(reaction, user):
return user != bot.user
while True:
reaction, user = await bot.wait_for('reaction_add', check=check)
if reaction.emoji == '👍':
await guild.create_text_channel(name=f'ticket - {user.name}', overwrites=overwrites)
msg = await ctx.channel.send(embed=discord.Embed(
description=f'A channel has been made for {user.name} to enter the tourney.'))
await asyncio.sleep(15)
await msg.delete()```
what are you tryna do
hmm
you should do some changes to the check
@sage otter so is there no way to use a hexcode?
because the event will get triggered for reactions in server/dm
0x<hex_code>
typehint as discord.Color
i did that
@client.command()
async def customrole(ctx, rolename, hexcode: discord.Color, member: discord.Member=None):
try:
await ctx.guild.create_role(name=rolename, color=hexcode, permissions=discord.Permissions(read_messages=None))
embed = discord.Embed(color="#ffff") # ❌
embed = discord.Embed(color=0xffff) # ✅
i want to accept hexcode from the user
and?
did it work?
nope
okay
role doesnt get created
then how about you send an error if you're getting one
no error too
because you're eating it with your except
!d discord.ext.commands.ColourConverter
class discord.ext.commands.ColourConverter(*args, **kwargs)```
Converts to a [`Colour`](https://discordpy.readthedocs.io/en/master/api.html#discord.Colour "discord.Colour").
Changed in version 1.5: Add an alias named ColorConverter
The following formats are accepted...
except Exception as e:
print(e)
taking input as a raw string and then doing
int('hex_code', 16) might work
does nobody literally know the ColorConverter

lol
well...okay ill remove it
Or just replace it with what I sent
.
don't really matter
removing the statement would show us the whole error tho
i have already put that 🥲 i know how to use try and except
not just the end
Yeah just remove both the try and except then.
its ok
@hasty iron ayo, thanx, it worked now
conv = commands.ColourConverter()
colour_object = await conv.convert(ctx, '#ffffff')
ctx?
As in a command.
@bot.command()
async def send_embed(ctx, color_string, *, title):
conv = commands.ColourConverter()
colour_object = await conv.convert(ctx, color_string)
await ctx.send(embed=discord.Embed(color=colour_object, title=title))
for cat in category:
await ctx.send(cat.name)
text = ""
for channel in cat.channels:
if channel.permissions_for(guild.me).view_channel:
text += f"{channel.name} | {channel.id}\n"
await ctx.send(text)```
if the category has 0 channel which bot can see, sends an error- `400 Bad Request (error code: 50006): Cannot send an empty message`
how do i pass that category ?
why not typehint?
Because, breaking news! I suck at them.
did you mean description=content ?
whats the attribute to list all working events? i have a dead event :/
I want to do a command that when executed just as .tag would change your nickname, but when you type .tag @user it would change that user's name. ```py
async def tag(self, ctx, member: discord.Member):
if member == None:
usr = ctx.author
else:
usr = member
How can i do this ? i get the incomplete command error
just make member optional
how to set role permissions on using guild.create_text_channel?
first, save the channel into a variable just like you do with a message
second, use discord.TextChannel.set_permissions
or use overwriters
^^^
yup
this is discord.py
you don't want me to toaster tag you
whats the attribute to list all working events? i have a dead event :/
Just because you're doing whatever this is inside of a bot does not make it dpy related. #python-discussion
"i have a toaster in my house, do i ask a carpenter how to fix it?" - Laggy
oof I just did
a lot
good afternoon, can someone teach how to put my bot 24/7
meh, it would be really hard to write a bot without rewrite dpy
ig you have to host your bot on a server
rewrite is the one with 'ctx' right
LOL
@elfin flicker
thank you
rewrite is the newer one right
it’s called "rewrite" for a reason
is there a way to get general server permissions only for a role?
anytime you check the docs, you see an "API Reference" that shows changes to that thing
almost everything
I used that wrong
anyways, yes
heyo I need help
with
I need to have a function where I can run a command and my bot will dm whoever I tagged
with a message that I set
@jade jolt any ideas?
a message in the command or just a message you stored in the bot
a message that I stored in the bot, so whenever I run it, it'll send the message set in the code to whoever I tagged @jade jolt
run the command with the prefix that is
@bot.command()
async def dm(ctx, user: discord.Member):
await user.send(predefined_message)
oh damn really?
yeah
change predefined_message to the message you set in the bot
I'm assuming I'll have to put in my command handler stuff
if you need to lol
''' @bot.command(name='8ball', help='Get an answer')
async def eightball(ctx, reaction, user):
balltwo = random.choice(ballin)
await ctx.send(balltwo) '''
crap it didn't format
Here's how to format Python code on Discord:
```py
print('Hello world!')
```
These are backticks, not quotes. Check this out if you can't find the backtick key.
but that's an example of what I use
what do you need to change?
no, nothing im just asking if that'll work for the code you gave me
it will
alr cool, tysm
np
what is the command to delete a channel
await Channel.delete()
!d discord.TextChannel.delete
await delete(*, reason=None)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).
Deletes the channel.
You must have [`manage_channels`](https://discordpy.readthedocs.io/en/master/api.html#discord.Permissions.manage_channels "discord.Permissions.manage_channels") permission to use this.
use an instance
!d discord.abc.GuildChannel.delete
await delete(*, reason=None)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).
Deletes the channel.
You must have [`manage_channels`](https://discordpy.readthedocs.io/en/master/api.html#discord.Permissions.manage_channels "discord.Permissions.manage_channels") permission to use this.
FreeCodeCamp made a video on dpy, 9 months ago, which was not the rewrite one. TechWithTim made one tutorial on rewrite 2 years ago. That is why i am confused Which one should i use?
which one is the latest
and easier and better
||i recommended none||
This section of the tutorial will show you how to create a new bot and add it to your server.
Guys, is there a way to check, if a role was made using my bot?
uh using the audit log maybe? that's the only way i can think of; but i don't really know how to do it
I want to check if the member's top most role is created by the bot, then only delete the role, otherwise send a message
What do you mean top most role
the top most role of the user?
Oh
!d discord.Member.top_role
property top_role: Role```
Returns the member’s highest role.
This is useful for figuring where a member stands in the role hierarchy chain.
I want to check if it was created by my bot
You will have to store it in a db or something
I don't know how you'd check if the role is created by the bot without storing it
ah i see, can i use a json file?
You just need to store True or False, so sure
ohh, ok thanx brother
or
Just store those Role IDs which your bot makes @upbeat otter
No need for True and False also
and check if the top most role id is in the JSON
ohhh, okay thanx
how do i get the role id 🥲
(:
The ID for the role.
It is unique
👍
:)
ok, so when i use the kick command ive added to my bot, its set up like this: ";kick [user] [reason]"
but when i use it and the reason is more than one word, the message after it that says who was kicked and why, it only shows the first word for the reason, how do i fix this?
Code
hello
hi?
I need help
so do i
Code bruh
lol
With?
does anyone of you know how to edit messages with this plugin? https://github.com/SilentJungle399/discord_buttons_plugin
I mean like send edited message with buttons
(for scrolling)
i know that, do you think i got one error and gave up? no, im here bcs i cant figure it out
msg = await ctx.send()
await msg.edit(**kwargs)
.....?
Yeaaa
i thought you were telling me that the answer to my problem was to code it
Lmao
@Bot.command(aliases= ['boot'])
@commands.has_permissions(kick_members=True)
async def kick(ctx, member : discord.Member, reason=None):
await member.kick()
await ctx.send(f'**{member}** was just kicked from the server for {reason}.')
ok
That is gonna fix it
what does the asterisk do?
It just consumes everything after member arg
hey, all you gotta do is async def kick(ctx, member : discord.Member, *, reason=None):
Yea
it's simple
if u add that star than it takes argument with more words
what
?
asterisk is the name of this symbol: *
ohhh
As I said, it just consumes all the args you provide after member param
yea it does that the following parameter can take more than one word
like if u don't have it there it will take only hello bur if yes than hello world
ok
also plz help
never knew that, no wonder my commands are getting messed up lol
ohok lol
Haha it is fine
ye
Do u know how to edit a message?
yes
but not with the plugin
bcs this is how u send a message
but idk how to edit it like this
well what is buttons
the plugin
the plugin lol
pepege
hence this
yup
but yes, thanks a lot for that help, i was just able to fix my super simple say command that i had no idea how to fix lol
np :D
hi i have problem with this https://pastebin.com/irDXfGnV
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.
error
Ignoring exception in on_message_delete Traceback (most recent call last): File "C:\Users\Komputer123\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\client.py", line 343, in _run_event await coro(*args, **kwargs) File "c:\Users\Komputer123\Desktop\Dc\bot\pepebot\cogs\logs.py", line 24, in on_message_delete await channel.send(f"**Wiadomość została usunięta przez** {message.author.mention}") AttributeError: 'NoneType' object has no attribute 'send'
How i make a command only usable by the bot owner?
if ctx.author.id == author id:
With author_id = owner_id right?
if ctx.author.id == your id:
There is a command decorator called is_owner
channel isn t set as a Channel object
use the @commands.is_owner() decorator
That's what i was looking for
or bot.is_owner depends if you’re using cogs or not
The decorator is the preferred way, as it allows you to handle the raised error when someone tries to call the command but is not the owner
channel = self.client.get_channel(log_channel)
To make that work i need to set the owner id when i create the bot, right?
It will automatically fetch it if it is not set
^
This doesn t mean that channel is a channel object lol
so how do I fix it?
If you are trying to delete a message automatically then in your on_message event you can get the channel by using the parameter u pass into the on_message
def on_message(message)
await message.channel.send("hi")
good job bro
Congrats!

I'm trying to get the channel I want to send a message to
Does anyone know how to receive input from the user after the command has been ran
Can you paste the code?
pastebin
so in a sense if I did !type bot will reply "What will you like to type" then the user could type again
!d discord.ext.commands.Bot.wait_for
wait_for(event, *, check=None, timeout=None)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).
Waits for a WebSocket event to be dispatched.
This could be used to wait for a user to reply to a message, or to react to a message, or to edit a message in a self-contained way.
The `timeout` parameter is passed onto [`asyncio.wait_for()`](https://docs.python.org/3/library/asyncio-task.html#asyncio.wait_for "(in Python v3.9)"). By default, it does not timeout. Note that this does propagate the [`asyncio.TimeoutError`](https://docs.python.org/3/library/asyncio-exceptions.html#asyncio.TimeoutError "(in Python v3.9)") for you in case of timeout and is provided for ease of use.
In case the event returns multiple arguments, a [`tuple`](https://docs.python.org/3/library/stdtypes.html#tuple "(in Python v3.9)") containing those arguments is returned instead. Please check the [documentation](https://discordpy.readthedocs.io/en/master/api.html#discord-api-events) for a list of events and their parameters.
This function returns the **first event that meets the requirements**...
You're trying to send a message into a log channel right?
yes
What is that log_channel? An id? The name?,
Did you convert it or just paste the id?
{
"token": "token",
"prefix" : ".",
"bot_author": "588377518470332417",
"log_channel": "834427936529711144"
}
my config
You re just passing it as a string, you have to convert that string into an int and then convert it into a channel using Converters
Try to search it, you can use other converter to, they're all the same
With member converters should be something at 100%
As an example, of course... They do different conversion xD
thanks for your help
but wait
I want it to take a channel id from the config.json file and then send a message to that channel
and not convert members
Yes yes, you need to convert that channel id from the config file into a TextChannel object, u do that using converters
? just use get_channel
and in their case they’re going to need to cast their channel id to an int
heyy
hi
i tried
@bot.command()
async def test(ctx, *, title):
print("hello")
extract_lyrics = SongLyrics(Your_API_KEY, GCS_ENGINE_ID)
em = discord.Embed(title=title,description ="here is your lyrics!",color=0xa3b3ff)
await ctx.send(embed=em)
and its not working
what error
okay
where is it erroring.?
my command is only on working in the bot
is it printing "hello" in console?
nooo
weird
!paste send your full code
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.
yeahhhh
maybe SongFinder is broken
?
SongLyrics*
async def test(ctx, *, title):
print("hello")
this command doesnt work
Help me 💔
idk y
show full code, no censoring
what are you using this for
What ? it’s checker
ok
why is some censored 👀
oh then lets see your code uncensored
.
what is it checking
and what is it taking
Why, tell me the error please
no responseeeeeeeeeeeeee
Anyone know why I can find a version that satisfies the requirement tensorflow?
Don't worry, I didn't do anything dangerous😂
ok then how are we supposed to help, you sent your code and was like "where error"
we dont have clairvoyance
sorry to disappoint you
here i have no error
in short no response
do i write wrong command ??
Because you use bot.event and overwrite the default on_message which processes commands
You need to add await bot.process_commands(message) to your on message
At the first indentation level and should be at the very bottom
Well, I don't know, so I'll rewrite the codes and check them out
!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/master/api.html#discord.on_message "discord.on_message") event. If you choose to override the [`on_message()`](https://discordpy.readthedocs.io/en/master/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/master/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/master/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/master/ext/commands/api.html#discord.ext.commands.Bot.get_context "discord.ext.commands.Bot.get_context") or [`invoke()`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.Bot.invoke "discord.ext.commands.Bot.invoke") if so.
if you dont know, then how are we supposed to?

I'm sure there is nothing wrong with my code
? Was there something I said wrong
but above code i get from discordpy site
ok, tldr we cant tell you the error because you yourself dont know
Yea, but again read what I said
You overwrite the default on_message so it doesn't process commands anymore
You need to manually add that
or at the very least use bot.listen()
i dont understand tbh
i just stated making bot 2 days ago
!d discord.ext.commands.Bot.listen
@listen(name=None)```
A decorator that registers another function as an external event listener. Basically this allows you to listen to multiple events from different places e.g. such as [`on_ready()`](https://discordpy.readthedocs.io/en/master/api.html#discord.on_ready "discord.on_ready")
The functions being listened to must be a [coroutine](https://docs.python.org/3/library/asyncio-task.html#coroutine "(in Python v3.9)").
Example...
If I knew what was wrong, I would have solved the problem a long time ago😂😂
👍 lemme check
ig i'm using bot command not event
event one is working well
or i misunderstand u @hasty iron
srry if i did I'm new to the syntax
wrong ping
AH?
This is not a Modmail thread.
yess
!paste can you send your whole code
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.
blanket
its cause they didn't process commands manually
after overwriting the default on_message
but all their commands work?
no they said none of them work iirc
except for that single one
do i have to send token too 👀
ofc not
uh
?
i have both of them in code
you’re running one
but i didnt send the client part
see this one u will understand
first i make it with client bcos i dont know about bot.command
now i'm doing with bot.command and its not working
i still don’t understand why you are using both
bot will have all the functionalities that client has + commands
bcos before i dont know bot exist
and client one i wrote yesterday
and it in my file
is there any error for using both??
in a single file
you’re not supposed to use both
You can't run both at the same time. commands.Bot.run() is a blocking function.
bot.run()
client.run()
Only bot.run() will work while client.run() will not since bot.run() is blocking.
!d discord.ext.commands.Bot.run
run(*args, **kwargs)```
A blocking call that abstracts away the event loop initialisation from you.
If you want more control over the event loop then this function should not be used. Use [`start()`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.Bot.start "discord.ext.commands.Bot.start") coroutine or [`connect()`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.Bot.connect "discord.ext.commands.Bot.connect") + [`login()`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.Bot.login "discord.ext.commands.Bot.login").
Roughly Equivalent to...
lol my case is opposite client is working
bot is not lol lemme remove the client part and check
i just have this now
everything else in comment
stilllllllll notttttttttttt working 😭
What is not working?
@dapper cobalt for client we use
client.run(os.getenv("TOKEN"))
for bot what we use??
tbh now idk what i'm doing 🙂
client is an instance of commands.Bot and bot is an instance of commands.Bot.
I have a question,
Is there a way to make a bot create a role or atleast just move it down some placements in the rankings
If yes how (please ping me so i get a notification since its 1 am i have school tmrw not normal school as a 5/6 yo to 15/16 yo)
If no have a great day / night wherever you are
okay 👀
it's the code with client u can see
i dont understand bot syntax tbh
syntax is all the same
discord.py is not a different language syntax does not change
commands.Bot inherits everything from discord.Client
The only thing you gotta really know is the new decorator, the command decorator i.e @bot.command() and how to form commands
Theres a quickstart on the commands extension on the documentation should be
Just read the hyperlinks from top down