#discord-bots
1 messages Β· Page 450 of 1
Python programmer.
Developing discord bots and making some other useless stuff.
[he/him]
XDDDDD
you first need to write a check function, which just returns true or false depending on the situation. You want to like check the message author, channel, and maybe more too
As you've been told, we will not be helping with this here. Tiktok doesn't allow this, and so it violates our #rules (specifically rule 5)
then you write your wait for, do this is a try: except, in the except set asyncio.TimeoutError so when the timeout is reached it will do an action
you can write pass in the except if you want it to do nothing
hopefully that clears it up more
to check whatever you want
like if you don't write a check any user in any channel in any server can trigger the wait_for
where a check can limit this to only the original author for instance
or maybe a specific channel
or whatever you want
the most common one would be same author same channel/message (depending on your event)
Yo seb. Sup
Oh okay, but how and where would fix that?
disable it?
@bot.command()
async def role_give(ctx):
# blahblahblah
def check(m):
return m.author == ctx.author and m.channel == ctx.channel
try:
await bot.wait_for("message", check=check, timeout = 60)
except asyncio.TimeoutError:
await ctx.send("Timeout reached, aborting")
return
this wold be like one of the most common wait_for with a check @tawdry perch
hi there
Long time no see
Out of context but I still remember that you were the first person who helped me with discord.py in this channel 
so i have code and stuff, how do i get the bot to execute the code?
send the message in dms and then use reaction_add event to wait for it
run it?
eh i've been on an off here and there just not as active here due to uni starting soon and doing other stuffs and bits. Ah well good to see you too
i have, but the bot doesnt do what i want it to.
Ah understandable
if you have the code then send it here and let use see what you have
also my mobile data is taking a dump atm lmao
ye
Lmao I am used to it
!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/stable/api.html#discord-api-events) for a list of events and their parameters.
This function returns the **first event that meets the requirements**...
there
Where did the search button go?
am in a moving train so i guess that explains

so all the things that bot.event has can be used in wait_for
My mobile data takes a dump even in my room
close it and its on the top right
Ah, I thought my client broke
pretty sure
it would be where the threads button is
Ah yea. Am used to that
It feels a bit weird now
anyways back on topic
@valid niche would you mind helping me test something with @unkempt canyon rq? Need a non-staff member
sure go ahead
#bot-commands pls
How do I use len() on emojis?
How do I set a limit for emojis
Reactions to a message. Reactions can be either custom emoji or standard unicode emoji.
This...?
Either true or false
your wait for returns a tuple of reaction, user, from this reaction you can do reaction.emoji and see what they reacted with
i would add a line to the check to ensure only those 2 emoji's will be accepted too
And won't continue
if you want to have the user choose from 2 reactions, have the check require either 2
then get the return value from wait_for (reaction, user) and check reaction.emoji. Put this in an if elif else against all emoji's to do the thing you want to do
Any idea why this error? Idk much about MetaClasses
```py
(aperture-venv) C:\Users\Asus\Documents\GitHub\Aperture>py launcher.py
Traceback (most recent call last):
File "launcher.py", line 10, in <module>
from aperture import ApertureBot
File "C:\Users\Asus\Documents\GitHub\Aperture\aperture_init_.py", line 32, in <module>
from aperture.core import listeners, constants, ApertureContext
File "C:\Users\Asus\Documents\GitHub\Aperture\aperture\core_init_.py", line 2, in <module>
from .context import ApertureContext
File "C:\Users\Asus\Documents\GitHub\Aperture\aperture\core\context.py", line 28, in <module>
class ApertureContext(commands.Context['ApertureBot']):
TypeError: 'ABCMeta' object is not subscriptable
Code: ```py
from __future__ import annotations
from typing import Any, Optional, TYPE_CHECKING
from discord.ext import commands
if TYPE_CHECKING:
from discord import Message
from aperture import ApertureBot
class ApertureContext(commands.Context['ApertureBot']):
async def reply(self, content: Optional[str] = None, **kwargs: Any) -> Message:
if not kwargs.get('mention_author', None):
kwargs['mention_author'] = False
return await super().reply(content=content, **kwargs)
def check(r, u):
return u == ctx.user and r.message == message and (r.emoji == "emoji1" or r.emoji == "emoji2")
try:
reaction, user = await bot.wait_for("reaction_add", timeout=60, check=check)
except asyncio.TimeoutError:
pass
if reaction.emoji == "emoji1":
# do stuff
else:
# do other stuff
``` @tawdry perch
you're trying to subscript the commands.Context class
commands.Context isn't subscriptable
I was told to do so, to typehint it's bot attr as my custom bot class 
wut?
i mean i already question the fact why you want to subclass context to make your own, the library itself will still use the commands.Context and not your own class

but also who told you to subscript it?
In dpy server
No, you can change the class passed as context
if you don't do a user argument, reaction becomes a tuple of (reaction, user). Alternatively you can do reaction, _ = await bot.wait_for(...) to indicate you want to discard user
ah right i guess. Anyways i don't know what danny is about then. You should ask him yourself in the dpy server then
because that doesn't look correct in my eyes
Ah I just changed the approach like ```py
class MyContext(commands.Context):
if TYPE_CHECKING:
from blah import MyBot
bot: MyBot
And guess that'll work
Since I only need it for type checking
like you can subclass it just fine
just the commands.Context class isn't subscriptable so not sure what danny is on about
Idk anything about metaclasses, I should learn them first before asking lol 
Me who doesn't know shit about Python: 
Also it used to work before, I just changed a few lines in another file and it stopped working
user never have any guild
Could be the person left the guild?
could be a dm
someone's spamming your bot's dm
Perfect antispam 
Wait wth, I just changed the directory of my code along with venv, and it is now using lower version of dpy 
the message.author returned a User, which isn't bound to a guild. Also use message.guild directly
well add_reaction adds to the message, and the message in this case is your own message and not the embed message
by replacing message with the embed message
messageable.send() returns the message that was sent
Everytime you compare the reaction.emoji to a emoji string
so you can catch that return value and add_reaction there
Isn't there an entire official discord server deticated to the development of discord bots?
Yeah
So it's prob better to ask questions there...
user[user.id] = {}
member object doesnt support item assignment
@client.event
async def on_member_join(member):
if member.guild.id == 876095186181189653:
try:
role = get(member.guild.rols,name="Member")
await client.add_roles(member, role)
except:
print("exception")
else:
print("WRONG SERVER SUCCESS")
return```
it prints nothing no error
you spelled roles wrong
oh~
also use id instead of member
since if u have two roles named member or some shit it will error
bruh
Also there's something weird with your check
you would have to set the send part to a varible
help
IT STILL DIDNT WORKED
@client.event
async def on_member_join(member):
if member.guild.id == 876095186181189653:
try:
role = get(member.guild.roles,name="MEMBER HEH")
await client.add_roles(member, role)
except:
print("exception")
else:
print("WRONG SERVER SUCCESS")
return```
whats wronggg IT PRINTS NO SHIT NO ERROR CLUELESS Frustrating
why do u have an else lol
well i assume user is a discord.User or a discord.Member, and these are non subscriptable classes
they aren't like a list or dictionary, you cannot add a value to them
def check(reaction, user):
return user == message.author and str(reaction.emoji) in ["emoji1", "emoji2"]
Try sth ΓΆike that
man can anyone help me:(
Its Member.guild.roles
um what?
In your get
u just made m capital but it in the parameter its smol m
You missspelled roles
i fixed it!!
Yeah im on mobile sry
oh
look here, doesnt works
k got it!!
await add_roles(*roles, reason=None, atomic=True)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).
Gives the member a number of [`Role`](https://discordpy.readthedocs.io/en/stable/api.html#discord.Role "discord.Role")s.
You must have the [`manage_roles`](https://discordpy.readthedocs.io/en/stable/api.html#discord.Permissions.manage_roles "discord.Permissions.manage_roles") permission to use this, and the added [`Role`](https://discordpy.readthedocs.io/en/stable/api.html#discord.Role "discord.Role")s must appear lower in the list of roles than the highest role of the member.
Are your emojis correct?
IT didnt worked either
await member.add_roles(member, role)```
delete the member
it doesn't take a member param
await member.add_roles(role)
yeah
Hm then I dont know
which makes me think it didn't even get to that part
IT STILL DIDNT WORKED @slate swan
ive added an if statement, my on_member_join code is big
Oh man i got exam tomorrow i just wanna make that code work
!paste
Pasting large amounts of code
If your code is too long to fit in a codeblock in discord, you can paste your code here:
https://paste.pydis.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.
paste it here
GOT IT
got itttt a return thing was stopping it
from my database if the content is not found in database the whole event gets returned
exam and wasting time for a bot
im addicted to coding cant help myself
can't wait till I can try out my c# experience
wait until it gets revenge
Hi, dank memer melsmie is gonna ban u from earth for bot violation thank you have a great afterlife
do you want to add those reactions on your embed message?
it would just make sense...
not important
alr bet
error isn't defined there, is it
at the end
well-
if you have an error handler that would eat this
if you disable it, you would know the problem
where does the code stop?
oof
not even the embed message?
Hey @cinder horizon!
It looks like you tried to attach a Python file - please use a code-pasting service such as https://paste.pythondiscord.com
do i paste the link aftr tht?
https://paste.pythondiscord.com/avozoquyin.py
welp this is a trial and smtng stoopid ik but i would like some help on this....wen the user runs !osu scores <2 or 3 or 4> lez say i want the bot to make it into 2 or 3 or how many so ever embeds and send with pagination....
the docs say it has to be done exactly like that
I don't know what could go wrong
!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/stable/api.html#discord-api-events) for a list of events and their parameters.
This function returns the **first event that meets the requirements**...
it's there in the examples
your logic in the check could go wrong, actually
def check(reaction, user):
return user == message.author and (str(reaction.emoji) == "" or str(reaction.emoji) == "")
paste your emojis there
since yours only worked when you clicked on the tick, as I saw
def check(reaction, user): return user == message.author and str(reaction.emoji) == "β
" and (str(reaction.emoji) == "β
" or str(reaction.emoji) == "β")
weird, not even going to lie
How do I handle this error
show code, sir
you are adding a string that returns none to another string
It's a mute command
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.
still no output?
I'll send it in a sec @slate swan
discord.on_member_join(member)``````py
discord.on_member_remove(member)```
Called when a [`Member`](https://discordpy.readthedocs.io/en/stable/api.html#discord.Member "discord.Member") leaves or joins a [`Guild`](https://discordpy.readthedocs.io/en/stable/api.html#discord.Guild "discord.Guild").
This requires [`Intents.members`](https://discordpy.readthedocs.io/en/stable/api.html#discord.Intents.members "discord.Intents.members") to be enabled.
Using intents in discord.py
Intents are a feature of Discord that tells the gateway exactly which events to send your bot. By default, discord.py has all intents enabled, except for the Members and Presences intents, which are needed for events such as on_member and to get members' statuses.
To enable one of these intents, you need to first go to the Discord developer portal, then to the bot page of your bot's application. Scroll down to the Privileged Gateway Intents section, then enable the intents that you need.
Next, in your bot you need to set the intents you want to connect with in the bot's constructor using the intents keyword argument, like this:
from discord import Intents
from discord.ext import commands
intents = Intents.default()
intents.members = True
bot = commands.Bot(command_prefix="!", intents=intents)
For more info about using intents, see the discord.py docs on intents, and for general information about them, see the Discord developer documentation on intents.
and if that's not the problem I'm jumping outta the window
jk
what's happening?
lmao
absolutely no output
and it might be cause of a space

we corrected all the other errors before they could occure
that's kinda disappointing too...

uh
easy
send the code
!code
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.
now here lmao
can i ask something? how can message content be none if it's on_message? π€
or do those invisible characters count as no content?
await message.author.send(embed=embed)
change that to
msg = await message.author.send(embed=embed)
ah okay π
to save the message object
exactly
and the rest works, ye
but you can change the timeouterror handler back
it can be an empty string if an attachment or embeds were sent iirc
nice
ahh, but i guess you'll still want that for his purpose. thanks though, didn't know
try:
reaction, user = await self.bot.wait_for("reaction_add", check=check, timeout = 60)
except Exception as e:
raise e
``` the try except is not needed
the error will get raiseed automatically
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: AttributeError: 'PermissionOverwrite' object has no attribute 'channel'
@commands.command()
async def lock(self,ctx,channel:discord.TextChannel=None,*,reason=None,new_name=None):
channel =ctx.channel
overwrite_role=ctx.message.channel.overwrites_for(ctx.guild.default_role)
if overwrite_role.channel.send_messages == False:
await channel.send("Channel is already locked down. Use `[prefix]unlock` to unlock.")```
then how will i write it
and I think there's a method for TextChannel that overwrites permissions for a role
!d discord.TextChannel
class discord.TextChannel```
Represents a Discord guild text channel.
`x == y` Checks if two channels are equal.
`x != y` Checks if two channels are not equal.
`hash(x)` Returns the channelβs hash.
`str(x)` Returns the channelβs name.
!d discord.TextChannel.overwrites_for
overwrites_for(obj)```
Returns the channel-specific overwrites for a member or a role.
oh that's not it

!d discord.TextChannel.set_permissions
await set_permissions(target, *, overwrite=see - below, reason=None, **permissions)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).
Sets the channel specific permission overwrites for a target in the channel.
The `target` parameter should either be a [`Member`](https://discordpy.readthedocs.io/en/stable/api.html#discord.Member "discord.Member") or a [`Role`](https://discordpy.readthedocs.io/en/stable/api.html#discord.Role "discord.Role") that belongs to guild.
The `overwrite` parameter, if given, must either be `None` or [`PermissionOverwrite`](https://discordpy.readthedocs.io/en/stable/api.html#discord.PermissionOverwrite "discord.PermissionOverwrite"). For convenience, you can pass in keyword arguments denoting [`Permissions`](https://discordpy.readthedocs.io/en/stable/api.html#discord.Permissions "discord.Permissions") attributes. If this is done, then you cannot mix the keyword arguments with the `overwrite` parameter.
If the `overwrite` parameter is `None`, then the permission overwrites are deleted.
You must have the [`manage_roles`](https://discordpy.readthedocs.io/en/stable/api.html#discord.Permissions.manage_roles "discord.Permissions.manage_roles") permission to use this...
so
overwrite role would just be assigned with
overwrite_role = ctx.guild.default_role
which you would use as target in the function above
then the overwrites, like
await channel.set_permissions(overwrite_role, send_messages=True)
i did that
I didn't even understand your question, did I
not working for the code i send
heck
Need any help?
got this
@commands.command()
async def unlock(self,ctx,channel:discord.TextChannel=None,*,reason=None,new_name=None):
channel = channel or ctx.channel
overwrite_role=ctx.message.ctx.channel.overwrites_for(ctx.guild.default_role)
if overwrite_role.send_messages == True:
await channel.send("Channel is Not locked down. Use `[prefix] lock` to unlock.") ```
you can tho...
Eh
if user mention channel and its is aldready lock it is code for it
damn use the first tag
Your indent is fucked up
no
yes
you would have to get that then check if send_message is False in it
@commands.command()
async def lock(self,ctx,channel:discord.TextChannel=None,*,reason=None):
channel =ctx.channel
overwrite_role=ctx.message.channel.overwrites_for(ctx.guild.default_role)
if overwrite_role.channel.send_messages == False:
await channel.send("Channel is already locked down. Use `[prefix]unlock` to unlock.")
else:
overwrite =channel.overwrites_for(ctx.guild.default_role)
overwrite.send_messages=False
await channel.set_permissions(ctx.guild.default_role,overwrite=overwrite)
embed=discord.Embed(title=f"{channel} is Locked ! ", description=f"reason: {reason}")
await ctx.send(embed=embed)
leave the reason as kwarg and put new_name before the asterisk
my code
π
now it send that error
whihc?
that's true
channel:discord.TextChannel?
yes
ignore that
but you could have a bool to lock ALL channels or just the current
the error would help
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: AttributeError: 'PermissionOverwrite' object has no attribute 'channel'
i am totally confused plz tell what is wrong in my code
for this error
overwrite_role.channel doesn't exist
it's just overwrite_role.send_messages
then ig it wasn't as okay as it looked...
could've guessed
if =lock #discord-bots and that channel is not locked still it say locked
if channel is not locked it still show channel is locked
yes it channel = channel or ctx.channel
can you print overwrite_role?
print it somewhere where it gets triggered...
i have an embed like
description=':emoji: text\n :2emoji: 2text'```
and it is supposed to look like
:emoji: text
:2emoji: 2text
but it looks like
:emoji: text
:2emoji: 2text
isnt there any other way to fix it
use \t?
we're looking for where it went wrong...
handler.setFormatter(
logging.Formatter('%(asctime)s:%(levelname)s:%(name)s: %(message)s'))``` can i change the way this prints into my console? I want it to print the same way everything else prints, look at the command used as a perfect example (ignore the shard ratelimit warning, im chunking guilds lol)
print(overwrite_role)
are you sure the everyone role's send_messages permission isn't False?
because there's no other way it would say it's locked
wait
@commands.command()
async def lock(self,ctx,channel:discord.TextChannel=None,*,reason=None):
channel =ctx.channel
overwrite_role=ctx.message.channel.overwrites_for(ctx.guild.default_role)
if overwrite_role.send_messages == False:
await channel.send("Channel is already locked down. Use `[prefix]unlock` to unlock.")
else:
overwrite =channel.overwrites_for(ctx.guild.default_role)
overwrite.send_messages=False
await channel.set_permissions(ctx.guild.default_role,overwrite=overwrite)
embed=discord.Embed(title=f"{channel} is Locked ! ", description=f"reason: {reason}")
await ctx.send(embed=embed)
in both of your statements it says it's locked

how i can use __init__.py for discord.py bot
which one does it actually say
bruh
if is for if channel mention is aldready locked
and other is for lock
if it is not locked
so it always says the first one
just⦠use it?
it's because it says the first one when @everyone's send_messages permission is False
if you set it to true, the second one's triggered
if channel is locked aldready it should send channel is lock
if channel is not locked it will go to else condition
lock that channel
you can just store locked channels somewhere and see if that channel is inside that list or whatever you stored shit in
is there a way to quickly get the highest heirarchy role of a member in string form
!d discord.Member.top_role
top_role```
Returns the memberβs highest role.
This is useful for figuring where a member stands in the role hierarchy chain.
returns a Role object
but I don't think you know how your code works....
that's true too
under the definition of overwrite_role, print overwrite_role.send_messages
uhhh, its returning the lowest heirarchy role
'Returns the memberβs highest role.'
wdym don't work
where did you put it bru
its returning the lowest
its returning the role at the bottom of the role list
inside my code
does dpy have a reversed day or wtf
then try Member.roles[0]
top-most one is admin, and bottom is muted. itd returning mutrf
no way
same thing
lol i am out my brain broke now
try Member.roles[-1]
ok?
Is there a way to restrict the bot to be invited in any discord server by only few specific members?
yes
I think you can do that in developer portal
u can track bot join has how many member if low just make it leave
Can u guide me please
now it works???????????
try printing the whole list
and just see the role order
Anybody knows what forks of discord.py have become rather prominent?
they were using Member.top_role
enchanced dpy or so i heard
And it's returning @everyone? 
Yeah I think I see some names which are familiar from the discord.py server
!pypi enhanced-dpy i think this
An enhanced discord.py, based off of the now-archived discord.py project - GitHub - iDevision/enhanced-discord.py: An enhanced discord.py, based off of the now-archived discord.py project
Maybe pycord, edpy, and more
there are some libraries alternative to discord py that use python
not forks though
So if this is off noone can make the bot join?
something like hikari i'd prefer over edpy tbh as of now
But if you can afford to edit the whole code again, I'd recommend using libs like hikari and hata
yeah
yes
Ehhhh, I looked at Hikari and it didn't look as nice in my opinion
Hata? That's new to me
π edpy isn't a bad choice at all
It's just like hikari, a third non-fork lib
but that's kind of true, switching from dpy to hikari may seem weird i guess
how do i track the server daily message count?
Also I don't think hikari has any commands extension in their GatewayBot..?
Well there's unofficial official ones, but not in the library.
I don't see that as a downside though
This looks unprofessional
For hikari too? 
Nvm I figured out
Yeah kinda but I heard they implemented everything.. Hikari is better than this if you need to switch the libs
For hikari? Yes, they're called Lightbulb and Tanjun I believe
I am in their Discord and there's special channel for those at least
Oh, I heard about Lightbulb
What?!
Whole asyncio is the lib 
lets say.. they're infamous for "copying" stuff
Their backend directory has almost everything required to run the bot 
Yeah I am definitely not gonna look at hata more. Here's a 1'236 and 564 changed commit called "Sharding go brr" https://github.com/HuyaneMatsu/hata/commit/abdfa6ce093b3c3afef276b3afe5626ddeefe55f
Maybe if you can wait for edpy to introduce slash commands just use that tbh 
π€·ββοΈ wasn't really looking for something new to use. Mostly wanted to know if there was any library that was growing big
Seeing Pycord making third bot class and killing internals, I'll better switch to hikari 
hata doesn't look like too bad of a lib tbh
Oh wow, Pycord has a lot of stars yeah
What suprises me is that no one forked through GitHub?
class Defaults:
Token = None
Cluster = None
class Config():
def __init__(self):
self.config_file = Path(".") / "config.ini"
self.config = configparser.ConfigParser(interpolation=None)
self.config.read(self.config_file, encoding="utf-8")
self._token = self.config.get("Bot", "Token", fallback=Defaults.Token)
self._cluster = self.config.get("DB", "Cluster", fallback=Defaults.Cluster)
self.check()
def check(self):
if not self._token:
logger.error(f"Please enter a Discord Bot Token!", extra={"emoji": WARNING})
time.sleep(1)
input_token = input("Token: ")
self.config.set(section="Bot", option="Token", value=f"{input_token}")
with open('config.ini', 'w') as configfile:
self.config.write(configfile)
if not self._cluster:
logger.error(f"Please enter the url so i can connect to MongoDB", extra={"emoji": WARNING})
time.sleep(1)
input_mongo = input("URL: ")
self.config.set(section="DB", option="Cluster", value=f"{input_mongo}")
with open('config.ini', 'w') as configfile:
self.config.write(configfile)
if not self._cluster or not self._token:
logger.critical(f"After you put everything in here you need to restart the Bot!", extra={"emoji": WARNING})
[Bot]
Token =
[DB]
Cluster =
configparser.NoSectionError: No section: 'Bot'
But the Section is there lmao
Like- it doesn't have that mark
import discord
bot = discord.Bot()
@bot.slash_command()
async def hello(ctx, name: str = None):
name = name or ctx.author.name
await ctx.send(f"Hello {name}!")
@bot.user_command(name="Say Hello")
async def hi(ctx, user):
await ctx.send(f"{ctx.author.mention} says hello to {user.name}!")
bot.run("token")
``` tbh i dont like this
which lib is that?
what would user_command mean ?
no clue
why does this let the code stop working?
messagecounts = {}
@client.command()
async def serverstats(ctx):
embed=discord.Embed(title=f" {ctx.guild.name}")
embed.add_field(name="Users:", value=ctx.guild.member_count, inline=False)
embed.add_field(name="Channels:", value=len(ctx.guild.channels), inline=False)
embed.add_field(name="Messages sent:", value=messagecounts[ctx.guild.id], inline=False)
await ctx.send(embed=embed)
@client.event
async def on_message(message):
if message.guild.id not in messagecounts.keys():
messagecounts[message.guild.id] = 0
messagecounts[message.guild.id] += 1```
it makes it look like somebody who really wanted to use discord.Bot instead of discord.ext.commands.Bot made this
atleast to me
They don't like this extension. They say this won't break anything just replace your constructor with this.
Then what's the sense of making a new class 
How do i count the guild daily messages?
Danny's approach was same, to have client let use slash and have discord/slash.py for commands extension
And this is nowhere compatible to commands extension, but they claim it to be 
use a good dpy fork
i wont use either
Atleast till now, dpy_good_fork_exist == True --> False 
ill make my own

disnake was created by the dev who created this library #discord-bots message
hi
it was pinned on this server as an alternative to slash commands
ok
so uhm the bot is recieving errors but its not even in the server?
im gonna lose my mind
and they made disnake that works amazing
its also really simple
another server then
someone knows?
no servrrs
the bot is literally just created
i get the token and start it
and its getting errors
Bro we are not god what error send it
errors that the command is not found
i use ?hi or literally anything and it says not found
its in the server right
it might be previous errors
?hi might not be a command on the bot
thats why it says command not found
Β―_(γ)_/Β―
How are you using ?hi if it's not in any server?
but im typing the command in a server that the bot is not in
how does it know im even typing it??
wait what
yeah exactly
Check if you're using wrong bot token
does anyone know how to track the server daily messages and joins?
on_message and on_member_join events
yes
!d discord.Guild.system_channel will return a discord.TextChannel object, so yes.
system_channel```
Returns the guildβs channel used for system messages.
If no channel is set, then this returns `None`.
says nonetype has attr send
im gonna get a seizure
that means guild doesn't have system channel
but server has a system channel
messagecounts = {}
@client.command()
async def serverstats(ctx):
embed=discord.Embed(title=f"Statystyki serwera {ctx.guild.name}")
embed.add_field(name="Users:", value=ctx.guild.member_count, inline=False)
embed.add_field(name="Channels:", value=len(ctx.guild.channels), inline=False)
embed.add_field(name="Messages sent:", value=messagecounts[ctx.guild.id], inline=False)
await ctx.send(embed=embed)
@client.event
async def on_message(message):
if message.guild.id not in messagecounts.keys():
messagecounts[message.guild.id] = 0
messagecounts[message.guild.id] += 1```
tried this but it would not reply
Why is messagecounts a dict?
He's doing it for each guild
Maybe..
Oh alright. But he can use a database instead tho?
Did it raise any errors
Nope Just Did Not reply
Well yes unless he's sure that his bot can be up 24/7
it has a system channel
Add a bot.process_commands(message) at 1st indentation level in on_message
Does the bot have access to that channel?

yes
Are you sure that the guild has a system channel
Try to print guild.system_channel.
should i put client instead bot?
And since you are doing it for every guild then you can use try...except.
whatever you defined your bot instance as
try:
await guild.system_channel.send("...")
except:
continue
the bot thinks its a whole new bot
alright
What's your issue?
says None wtf how can that be lol
1 sec
I prefer using πcontextlib.suppress()
Try this.
I make things basic. Plus, idk what the heck that is. 
im noob in python
so instead on message put bot.process_commands(message) ?
Is this the first guild that the bot goes through in the loop?
Try this.
Read it, Add a bot.process_commands(message) at 1st indentation level in on_message
Can you send your code again?
Wouldn't solve his problem tho :v
It's basically same just saves 2 lines of code 
still same , None
I know but just so it doesn't break.
!d discord.Intents.guilds
Whether guild related events are enabled.
This corresponds to the following events...
You can make it easier. Instead of looping through the guilds to find the one with the same name just do guild = discord.utils.get(self.bot.guilds, name=serverName).
yes
They leave at the end.
xd
sec
Why do you underline the guild's name instead of bolding it?
He's looping through guilds
leave a guild froma diff guild
yes
Oh
Is it None now
let me try
str(guild.system_channel} is different from guild.system_channel ig
You don't need serverName == guild.name since utils.get will always return that only
what about guidl.id?
that's fine
!d discord.utils.find This one is good too
discord.utils.find(predicate, seq)```
A helper to return the first element found in the sequence that meets the predicate. For example:
```py
member = discord.utils.find(lambda m: m.name == 'Mighty', channel.guild.members)
``` would find the first [`Member`](https://discordpy.readthedocs.io/en/stable/api.html#discord.Member "discord.Member") whose name is βMightyβ and return it. If an entry is not found, then `None` is returned.
This is different from [`filter()`](https://docs.python.org/3/library/functions.html#filter "(in Python v3.9)") due to the fact it stops the moment it finds a valid entry.
guild is now a discord.Guild object.
it works
guys how can i get avatar from code like this 167a2c872f7de4ff4f04873d86535cab ?
ty guys
No problemo.
What even is that code
That's my avatar's url https://cdn.discordapp.com/avatars/510736807999307786/9e1c0394d704342018e59625444671ff.webp?size=1024
https://cdn.discordapp.com/avatars/user_id/avatar_code.webp?size=1024
@dapper cobalt hey can u get back to me in the dm, there's context so that's why I haven't asked here again
thanks :))0
You can ask here.
No problem. 
I don't mean that I don't want to help you in DMs, but I've been programming in Python for only 2 years. So of course asking here will be better for you since there are people more experienced than me.
async def send_pages(self):
destination = self.get_destination()
embed = discord.Embed(title=":robot: **How to use Twitch Tipping Bot**",
description="The following commands can be used to setup the bot correctly!")
embed.set_author(name="Twitch Tipping Bot - Help")
embed.add_field(name='!help',
value="Shows this embedded message in your DM's.")
embed.colour = uBot.Colors.blue
for page in self.paginator.pages:
embed.description += page
await destination.send(embed=embed)
bot.help_command = Help(dm_help=True)```
how to make this admin only ?
i've been trying to figure it for one hour now and i can't find anything about it
Wouldn't it be better to make a tickets system instead then?
I don't think you can do that with MinimalHelpCommand, but in HelpCommand, you have add_check 
i am still confused how to track daily joins and messages
oooh let me see
- Your Bot should be online the whole time. In case bot goes offline, it will give wrong results
- Use
on_member_joinandon_message
Yeah Ma Bot Is 24/7
how do i make a role can't see a specific channel
Set role permissions as view_channel = False
Yes Ik But How I use them?
@client.event
async def on_message(message):
if message.guild.id not in messagecounts.keys():
messagecounts[message.guild.id] = 0
messagecounts[message.guild.id] += 1```
How can I run an async function with bot.loop? If even possible
Actually nvm, anyone has any idea how to make API requests on start-up?
https://discordpy.readthedocs.io/en/stable/api.html#discord.TextChannel.edit Use this method and pass in a dict of overwrites like ```py
overwrites = {
role_object: discord.permissionoverwrite object
}
got it
how do i make a member can see it and a role can't, do i replace role_object with Member?
@slate swan
You can also put member object there
and multiple also
run_until_complete exist
loop.create_task(my_async_func())
what create_task do 

Thanks! But you have an idea how to make an API request on start-up?
Start up as in?
Like once right after bot.run
Well bot.run calls login and connect
Put the API request in connect and it should be fine

Its an async method as well so

Oh so it's not blocking?
the connect part is the blocking part iirc because its a while loop for listening to websocket messages
I'm not sure I don't really know much about discord.py's websocket stuff
Yeah it's blocking
It runs on different thread? 
await asyncio.sleep(2)
await msg.edit(content='Getting IP: {}'.format(random.choice(string.digits.split('.') for i in range(10))))
how would i make a fake ip with ascii
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
@bot.event #Or bot.listen(), bot.listen('on_member_join'), commands.Cog.listener() and commands.Cog.listener('on_member_join')
async def on_member_join(member: discord.Member): #Don't forger self if in a class
channel = member.guild.get_channel(channel_id)
await channel.send(f'{member.mention} joined {member.guild.name}')```
!d discord.on_member_join
discord.on_member_join(member)``````py
discord.on_member_remove(member)```
Called when a [`Member`](https://discordpy.readthedocs.io/en/stable/api.html#discord.Member "discord.Member") leaves or joins a [`Guild`](https://discordpy.readthedocs.io/en/stable/api.html#discord.Guild "discord.Guild").
This requires [`Intents.members`](https://discordpy.readthedocs.io/en/stable/api.html#discord.Intents.members "discord.Intents.members") to be enabled.
It's set_footer
You can't have two footers
Welcome to the party pal
Well it still triggers
Which means channel will be None
Because that other guild doesn't have a channel with that id
do i put a perms integer?
discord.PermissionOverwrite(view_channels=False, ...)
also, if i use 0 as discord.Permissions would that make no perms to a role/memner?
@commands.group(invoke_without_command=True)
@commands.guild_only()
async def voice(self, ctx):
embed = discord.Embed(title='Canali Vocali Auto', description=all_msg(type='description_def', guild=ctx.guild.id), colour=colorprd())
embed.add_field(name='Canali Vocali', value=all_msg('vc_cmds_help', ctx.guild.id))
embed.add_field(name='Testing', value='Testing..')
embed.add_field(name='Generatore', value=all_msg('admin_cmds_help', ctx.guild.id))
# buttons = [ActionRow(
# Button(
# ),
# Button(
# )
# )]
await ctx.send(embed=embed)
await self.generator(ctx)
@voice.group(invoke_without_command=True)
@commands.guild_only()
@commands.has_permissions(manage_channels=True)
async def generator(self, ctx):
embed = discord.Embed(title=':controlpanel: Pannello dei Generatori', description=all_msg('vc_gen_def', ctx.guild.id), colour=colorprd())
embed.set_thumbnail(url=self.client.user.avatar_url)
msg = await ctx.send(embed=embed, components=all_buttons('gen_cp'))
click_buttons('gen_cp', msg)
Why if I do !voice it send me the message of the command !voice generator?
!d discord.ext.commands.Command.get_cooldown_retry_after
get_cooldown_retry_after(ctx)```
Retrieves the amount of seconds before this command can be tried again.
New in version 1.4.
@slate swan
thx
user/member.send
!d discord.User.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.
@slate swan
pls help
guys how to use the split func
!d str.split
str.split(sep=None, maxsplit=- 1)```
Return a list of the words in the string, using *sep* as the delimiter string. If *maxsplit* is given, at most *maxsplit* splits are done (thus, the list will have at most `maxsplit+1` elements). If *maxsplit* is not specified or `-1`, then there is no limit on the number of splits (all possible splits are made).
If *sep* is given, consecutive delimiters are not grouped together and are deemed to delimit empty strings (for example, `'1,,2'.split(',')` returns `['1', '', '2']`). The *sep* argument may consist of multiple characters (for example, `'1<>2<>3'.split('<>')` returns `['1', '2', '3']`). Splitting an empty string with a specified separator returns `['']`.
For example:
!e ```py
x = "hello;world"
print(x.split(";"))
@high flame :white_check_mark: Your eval job has completed with return code 0.
['hello', 'world']
@slate swan will this work? i want to use a perms integer
Not sure, I never understood this Permission thing, how dpy handles it
try it
members is a role
alr
!e
x = "33133133132 3213213213123 123212312333"
print(x.split)
@hoary gust :white_check_mark: Your eval job has completed with return code 0.
<built-in method split of str object at 0x7f0203f86150>
!e
x = "33133133132, 3213213213123, 123212312333"
print(x.split(","))
@hoary gust :white_check_mark: Your eval job has completed with return code 0.
['33133133132', ' 3213213213123', ' 123212312333']
@hoary gust #bot-commands
is there a way to unban a user while the bot is in a guild but not a person
i can use discord.Member there?
sry i didnt meant to use it here i was just testing
!d discord.Object -- Make a discord.Object instance with the user's id to be unbanned, and use guild.unban
class discord.Object(id)```
Represents a generic Discord object.
The purpose of this class is to allow you to create βminiatureβ versions of data classes if you want to pass in just an ID. Most functions that take in a specific data class with an ID can also take in this class as a substitute instead. Note that even though this is the case, not all objects (if any) actually inherit from this class.
There are also some cases where some websocket events are received in [strange order](https://github.com/Rapptz/discord.py/issues/21) and when such events happened you would receive this class rather than the actual data class. These cases are extremely rare.
`x == y` Checks if two objects are equal.
`x != y` Checks if two objects are not equal.
`hash(x)` Returns the objectβs hash.
so if i was wanting to get the cooldown of a command would i do: self.command_name.and.get_cooldown_retry_after()
is there a way to only DM someone if you can?
just use try except
that is what i am trying right now(pun intended)
@slate swan what is the use of append
how can i like def channel?
and it works
try except will work ofc
how can i like def channel?
name of channel
ah there is a way
i want guild name
u can fetch that
self.bot.get_guild
wrong one
!e Append means insert an item into a list at the last, like
define a list with some items ```py
x = [1, 2, 3]
print(x)
Now append something into it ```py
x.append(5)
print(x)
@slate swan :white_check_mark: Your eval job has completed with return code 0.
001 | [1, 2, 3]
002 | [1, 2, 3, 5]
you don't understand
how do i set up heroku on mac
help please
Also it should be a question to #python-discussion
ok but still why 1,2,3 and then 5 ?
ok i get it
no reason, I just do that way lol
u inserted it in the list
bruh
??

ok thanks bud
define it
read the error
i did
define it
then what does it say?
users isnt define
then do it
but how do i define it
by learning python
what r u trying to do ?
make a bank system
Considerr asking it in proper channel like #python-discussion or #βο½how-to-get-help :)
so like .beg. or .work
ok
does anyone know how to set up heroku
so that people can gamble and stuff
then claim their money for actuall things
so like 100k = voucher
idk just some fun
so dank member
make something easier stuff before getting into economy
i alreday did
im just adding to a bot i already have
then you dont know how to define something?
@kindred epoch would you happen to know lol
what is user in ur code
yea i do, lemme send a vid which worked for me
ah u need to define it
but its not recommended
o
i am on mac, i was following this vid
ctx.author.id to get the executors id
wdym
o
u need to define it
i already have that
@stoic flicker can u show ur code
yee
its not recommended hosting a bot on heroku: #discord-bots message
i cant fit it into one picture
!paste
Pasting large amounts of code
If your code is too long to fit in a codeblock in discord, you can paste your code here:
https://paste.pydis.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.
why
heroku is not for bots
read what i linked
Heroku is meant for hosting webapps like apis kinda stuff
thats the part i added
but i already have imports and stuff
can u share ur code
i see, still gonna try to run it on there until the free trial is over
Will you share more traceback? A lot of it is hidden or cropepd
o
File "C:\Users\leyton#\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\discord\ext\commands\bot.py", line 939, in invoke
await ctx.command.invoke(ctx)
File "C:\Users\leyton#\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\discord\ext\commands\core.py", line 863, in invoke
await injected(*ctx.args, **ctx.kwargs)
File "C:\Users\leyton#\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\discord\ext\commands\core.py", line 94, in wrapped
raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: NameError: name 'users' is not defined
This isn't the whole 
free trial is unlimited but the last day of the month is not
uhh it is
This module in my bot is used to get a list of channel IDs and their names in the server.... but the problem is how do I make it send all the IDs and messages at once py @Blank.command(aliases=['cid']) async def channels(ctx): await ctx.message.delete() i=0 c=[] d=[] for channel in ctx.guild.channels: c.append(channel.id) d.append(channel.name) for x in range(len(c) and len(d)): msg+=f"{c[x]} = {d[x]}\n"
In this I tried to await ctx.send the value of msg but it shows that I have called it before it is assigned... Please help
No, scroll up and you'll find more. I'm trying to get the line which raised exc
i did
Traceback (most recent call last):
File "C:\Users\leyton#\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\discord\ext\commands\bot.py", line 939, in invoke
await ctx.command.invoke(ctx)
File "C:\Users\leyton#\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\discord\ext\commands\core.py", line 863, in invoke
await injected(*ctx.args, **ctx.kwargs)
File "C:\Users\leyton#\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\discord\ext\commands\core.py", line 94, in wrapped
raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: NameError: name 'users' is not defined
isnt it like 500hrs and they will stop running your app
yes, thats for a month
after a new month starts, it resets
the free trail resets?
yes
so whats the point of paying on heroku
@stoic flicker Don't dm me the error, you can use the paste too. Also the error is
I don't know 
o
Try to read it once
that r is meant to be a w
ah i see
i did

anyways what vid did you follow
users
@kindred epoch
o Lmao
if thats what caused the full thing to break
still broken
tf
bruh
if ctx.on_raw_reaction_add:
await user1.send("AHA")
i created the files in created in github, in vsc
Don't use dpy before learning python 
and?
this is what pops up when i click on import
its not letting me drag the files
oh wait i think thats only to import another repository
!empty-json
When using JSON, you might run into the following error:
JSONDecodeError: Expecting value: line 1 column 1 (char 0)
This error could have appeared because you just created the JSON file and there is nothing in it at the moment.
Whilst having empty data is no problem, the file itself may never be completely empty.
You most likely wanted to structure your JSON as a dictionary. To do this, edit your empty JSON file so that it instead contains {}.
Different data types are also supported. If you wish to read more on these, please refer to this article.
!paste
Pasting large amounts of code
If your code is too long to fit in a codeblock in discord, you can paste your code here:
https://paste.pydis.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.
why heroku tho
@kindred epoch what do i enter here
a friend suggested it
screw that friend then
lol
you cannot go any worse than heroku
are you following the tutorial?
yes
idk what really is worse
replit or heroku
which was his file name im pretty sure
atleast you dont get api banned on heroku
then do it
lol
I have no idea how to save the ad because when 2 people use the command , wsp, the bot does not allow me to use, yes or , no https://paste.pythondiscord.com/ovaledusip.py
Hi, i need some help
Is there a way to inline discord buttons?
We tried to use .center(15, "** **"),
But it only takes 1 char and it takes it raw anyway
nope
Is there a work around maybe?
- Nothing like
ctx.on_raw_reaction_addexist - Idk what are you trying to convey in the replied message
- It's an indentation error
- Please learn basic python.
Thanks
i have problem
buy\
no idea
click the pencil button
But I don't know how to do or save or do it
and then do it 
Sorry idk
Please don't use ableist language in this server
sorry
sadge
#5865F2
@kindred epoch when i make new files in vsc, do i just upload it to github in that respository
do you understand what @slate swan is trying to say?
if they are cog files that the bot uses then yes
ok
but i have problem
ty ill hit u up if i got any issues with it @kindred epoch
np
is it related to #discord-bots ?
yes
Ignoring exception in command beg:
Traceback (most recent call last):
File "C:\Users\leyton#\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\discord\ext\commands\core.py", line 85, in wrapped
ret = await coro(*args, **kwargs)
File "C:\Users\leyton#\Documents!!!!bot\awdawd.py", line 147, in beg
await open_account(ctx.author)
File "C:\Users\leyton#\Documents!!!!bot\awdawd.py", line 164, in open_account
users = await get_bank_data()
File "C:\Users\leyton#\Documents!!!!bot\awdawd.py", line 179, in get_bank_data
user = json.load(f)
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.2032.0_x64__qbz5n2kfra8p0\lib\json_init_.py", line 293, in load
return loads(fp.read(),
io.UnsupportedOperation: not readable
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "C:\Users\leyton#\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\discord\ext\commands\bot.py", line 939, in invoke
await ctx.command.invoke(ctx)
File "C:\Users\leyton#\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\discord\ext\commands\core.py", line 863, in invoke
await injected(*ctx.args, **ctx.kwargs)
File "C:\Users\leyton#\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\discord\ext\commands\core.py", line 94, in wrapped
raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: UnsupportedOperation: not readable
Ignoring exception in command balance:
Traceback (most recent call last):
File "C:\Users\leyton#\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\discord\ext\commands\core.py", line 85, in wrapped
ret = await coro(*args, **kwargs)
File "C:\Users\leyton#\Documents!!!!bot\awdawd.py", line 133, in balance
await open_account(ctx.author)
File "C:\Users\leyton#\Documents!!!!bot\awdawd.py", line 164, in open_account
users = await get_bank_data()
File "C:\Users\leyton#\Documents!!!!bot\awdawd.py", line 179, in get_bank_data
user = json.load(f)
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.2032.0_x64__qbz5n2kfra8p0\lib\json_init_.py", line 293, in load
return loads(fp.read(),
io.UnsupportedOperation: not readable
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "C:\Users\leyton#\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\discord\ext\commands\bot.py", line 939, in invoke
await ctx.command.invoke(ctx)
File "C:\Users\leyton#\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\discord\ext\commands\core.py", line 863, in invoke
await injected(*ctx.args, **ctx.kwargs)
File "C:\Users\leyton#\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\discord\ext\commands\core.py", line 94, in wrapped
raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: UnsupportedOperation: not readable
uhh help
Everything you're doing in your bot isn't related to dpy. An indentation error is nowhere related.
Also dpy is not a library for beginners, even it's maintainer says so.
I'd recommend you to learn basic concepts of python and oop before dpy and have a basic project.
If you still want to stick with dpy, we (or atleast I) can't help with it.
mhm
???
my error
DISCORD.PY i use this wtf??????????
dpy = shorthand for discord.py
It didn't work
your json isn't readable it seems like
how
You can't use custom emojis in buttons
i have {}
π’π’π’π’π’π’
inside
you think https://paste.pythondiscord.com/ovaledusip.py its no discord.py ?
huh
can we see around line 179
yee
Unicode emojis only @kindred epoch
well, my bot uses custom emojis in buttons
you opened it as write mode but you're reading data
@kindred epoch
sure
Haha
how do i change
change "w" to "r"
@compact eagle
Will you please read that message atleast: #discord-bots message 
How?!
But this information should go in a database!!!
Magic
Please help me @kindred epoch
quite elegant :)
uh sure
I'm using the emoji kwarg
nice \


