#discord-bots
1 messages · Page 1048 of 1
they dont have Intents.message_content in their code
It will take me 1 month pls help it's my request pls
I'll learn it after making command surely
and stop using discord_components pls 🙏
Why?
That's why I switched to discord.py v2 😄
the library is no longer maintained
components are available in discord.py already
they mess with discord.py internals causing unwanted errors
great!, btw you issue is you pass the intents in a wrong way
That’s not possible without spoon feeding
intents = discord.Intents.default()
intents.members = True
client = commands.Bot(command_prefix="$", intents=intents, message_content=True, messages=True)``` should be ```py
intents = discord.Intents.default()
intents.members = True
intents.message_content=True
intents.messages=True
client = commands.Bot(command_prefix="$", intents=intents, )```
And I doubt anyone here is going to give you fully working code for exactly what you want
how do i set perm for a role for channel in ctx.guild.channels?
But pls
But
Can’t help you unless you put in a little bit of effort by reading the docs
someone/
I need to see all the python series for it
-;-
@robust fulcrum u go and do some search on github
Me school student i dint have really time to see the all python so i asked here
Already searched
which grade?
8
rofl, it was the issue..
thanks for help, it just saved me
So school student is not a valid excuse
I’m sorry, I have experience with aiohttp but not pokeapi. The only way is to read the documentation about their endpoints, methods, parameters, etc yourself, then ask for help if that isn’t working
@robust fulcrum i can give you a basic idea how that works...
Ok
I'll be happy :)
don't expect too much
He's just giving u idea
starting off with making a request, you would be using requests/aiohttp to make a request to that website ```py
import requests
import aiohttp
response = requests.get("url to the endpoint") #in requests
response = await clientsession.get("url to the endpoint") # in aiohttp where clientsession is an aiohttp.ClientSession object
, now you would like getting the response json which can be done easily bypy
response_json = response.json() # in requests
response_json = await response.json() #in aiohttp
``` response_json is a dictionary which you can print and use to get info
if you wanna try something easier, i made a library named pokelance ( pip install pokelance) which you can use if you're interested
is there a way to create discord channels via a bot command?
good for you that the site does not require any kind of headers or auth
!d discord.Guild.create_text_channel
await create_text_channel(name, *, reason=None, category=None, position=..., topic=..., slowmode_delay=..., nsfw=..., overwrites=..., default_auto_archive_duration=...)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).
Creates a [`TextChannel`](https://discordpy.readthedocs.io/en/master/api.html#discord.TextChannel "discord.TextChannel") for the guild.
Note that you need the [`manage_channels`](https://discordpy.readthedocs.io/en/master/api.html#discord.Permissions.manage_channels "discord.Permissions.manage_channels") permission
to create the channel...
aight bet
@robust fulcrum if you dont understand a part of this, feel free to ping me
how do i set perm for a role for channel in ctx.guild.channels?
!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/master/api.html#discord.Member "discord.Member") or a
[`Role`](https://discordpy.readthedocs.io/en/master/api.html#discord.Role "discord.Role") that belongs to guild...
if result is None:
role = await ctx.guild.create_role(name="Muted")
for channel in ctx.guild.channels:
await channel.set_permissions(role, speak=False, send_messages=False, read_message_history=True, read_messages=True)```
this is my code
and its setting the perm only for ctx channel
Welcome to discord bots section
Hello, could someone help me to create a bot because I'm struggling a bit ?
What do you need help with?
drop the link to discord.ui
@sick birchcan u go through my code
Is there specifically anything wrong with it?
I would need someone to explain to me how to code a vinted bot that sends the latest articles if possible
Where do these articles come from?
vinted
@sick birch which module is better to use for buttons in discord.py ?
Wdym which module?
Check if they have an API, if not it’s going to be a bit harder
yes
@sick birch so that there are buttons under the message
yes they do
but after I have the api I don't know how to do it
Use discord.ui
you need some experience for that
Sadly you can't just project something and then think that you can do it without any experience at what do you need to do it.
You will need to check if vinted has an API, if not you will have to use some webscraping method and it will be a lot harder, if they do you will need to study requests and learn how to get datas from the API and then you can start with making your bot
to install, you just need to write pip install discord.ui or otherwise ?
If you have 2.0 it should come preinstalled
agree thank you
and i have a last question, do you have any videos to advise me to learn python and how to code bots ?
Well I have 2.0
Can someone help me making music bot?
I dunno, Robin can I sponsor a youtuber here? 
Then you should just be able to import it
Sure, since you’re helping them out
it is not setting the perms what is wrong @sick birch
please drop the links to 2.0
The docs?
hey i have a issue when switching from requests to aiohttp is anyone able to help? i have added print messages to see how far it gets and i dont get any issues it just stops
print("hu")
print(members.avatar.url)
print(joke.avatar.url)
async with aiohttp.ClientSession() as cs:
print("56")
async with cs.get(members.avatar.url) as r:
img_data = await r.read()
print("huh")
with open('./image/match2.jpg', 'wb') as handler:
print("looop")
handler.write(img_data)
print("work?")
print("here")
async with cs.get(joke.avatar.url) as r:
img_datas = await r.read()
with open('./image/match1.jpg', 'wb') as handler:
handler.write(img_datas)
await cs.close()
print("lo")
output
hu
https://cdn.discordapp.com/avatars/477895129084985354/ffc1a0e6bb690c37f3c7fc5358ba47b2.png?size=1024
https://cdn.discordapp.com/avatars/443893362135793670/283a5b1f7e2ac9959eb4a26ffc6d2cb3.png?size=1024
!d discord.Asset.read
await read()```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).
Retrieves the content of this asset as a [`bytes`](https://docs.python.org/3/library/stdtypes.html#bytes "(in Python v3.10)") object.
like some version discord.py available on github@sick birch
Alri
You can check TechWithTim channel as you're approaching python as beginner, he explains things very well. After that you will need to search something more specific, i recommend study the docs if you can't find anything more thorough
2.0
OMG not that
thanks
I’m not sure what you’re asking for. Buttons have full support with regular old discordpy with nothing extra
Robin could u help me making music bot py
okay thanks
Music bots are in violation of YouTube’s terms of service, and in compliance with rule 5 we are not allowed to provide assistance regarding that topic
5. Do not provide or request help on projects that may break laws, breach terms of services, or are malicious or inappropriate.
what just img=await memebrs.avatar.read() sorry im still kinda new to this not sure what im doing
yes!
okay thank you ill try it
!d discord.Asset.read
await read()```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).
Retrieves the content of this asset as a [`bytes`](https://docs.python.org/3/library/stdtypes.html#bytes "(in Python v3.10)") object.
The method you're using will do this
so essentially you will get the avatar of the user as a bytes object
ahh okay thank you ill try it
shit fucking needs this down to be banned on github
https://github.com/Rapptz/discord.py
What?
this shit has never worked for me!
sounds like a "you" issue, since there are hundreds of people using it already.
this shit sets not discord.py ah error.py
Not sure what you’re on about but I’d be happy to help you fix it
I installed version 2.0 via pip install discord2. But I decided to make buttons, deleted that version and decided to put it on this link and everything stopped working for me
okay im back hahaha
with open('./image/match1.jpg', 'wb') as handler:
handler.write(await members.avatar.read)
with no error but windows says its corrupted
2.0 is not on pip afaik
You have to install it manually
Bruh first of all calm down a little
then to install d.py 2.0 you will need to do it using git
I do not know but using pip install discord.py I have two teams working
two teams?
slash_command
discord2?
!pypi discord2
wait what is this
no no
I have it worth it
https://github.com/Rapptz/discord.py this is the 2.0 branch
shit!!!
like
this is nothing but pycord lmao
lol
you not being able to use something doesn't make it "shit" , and fyi your "like" is just a forked ( copied ) version of tje "shit"
@slate swanahahahah. This git will finally be removed
who said that?
well, it's just that someone copied this shit much better
I'm so lost
@slate swan
it is better to install the one through pip than through git
Discord.py on pip is 1.7.3 which does not have button support
pip install disocrd2 --> discord2==2.0.1
Interesting
what makes you say that xd? on basis of source code or syntax
Sure, that'll be $100
Sure, gimme yr HunCash ID
pycord but shit-er
Rip
.again
I think their name explains their motives quite well
How does the disnake.Spotifiy thing work and how can I get a spotify activity?!?!
disnake.Spotify is an instance of discord.Activity, you can loop on a member.activities and check if isinstance( activity, discord.Spotify is true
wait, how to I get others activities, I have been doing it, but it's blank
I just realize because I did it to the bot, worked, everyone or anything else, nothing works
!d disnake.Member.activities
The activities that the user is currently doing.
Note
Due to a Discord API limitation, a user’s Spotify activity may not appear if they are listening to a song with a title longer than 128 characters. See #1738 for more information.
no, the intent or something?
collecting data on discord bot patreon earnings and votes
is there an intent I need?
yeah, sorry, you need Members intent
*presence
not that~
if they already have a member object, thats not required
whats the issue?
when I try get people activity, it doesn't work
they dont have an activity going on?
show ur code too
(this works on the bot itself but not others)
Based on lots of maffs, you earn £31 per 1000 servers per month on average with game bots, with my current ad buys it'd cost £70 for 1000 servers (maybe)
so if retention is less than 2 months on average it'd be a loss 
How can i get when it was deleted at?
<t:{int(message.deleted_at.timestamp())}:F>```
you sure thats the correct app? also,
can i see you actual bot instance
it only works on itself, I just re-added it and going to try test it again
I’m developing a bot and I tried to run it, and I got a unable to create process using
It then says under Process finished with exit code 101
HELP
and it should be, I'd be really confused if it wasn't...
@slate swan is that what you wanted?
I just can't fit the overwrites to on_ready, on_disconect, on_command_error, or on_resumed...
Why don't you use get_member instead of fetch_member
Someone please HELP
ngl, forgot it was a thing xD
yeah thats what i needed, well your code seems correct and the intents too
cant say what the problem is, but lemme recheck
OMFG, THAT WAASS ITITITI
sorry, I'm just pissed xD
thank you so much
Make sure you have python installed and in path

It is that’s why it’s weird????
Probably
anyone?
u using a venv?
It’s already in path
message does not have a deleted_at property
yes.
if you are in a on_message_delete event etc, just use datetime.datetime.now()
just double checked everything is in path and if due is still there @stone beacon
I had this issue. Mine was fixed using this: https://stackoverflow.com/questions/61641280/python3-8-venv-returned-exit-status-101/62207756#62207756
Is this related to me?
Ya
If so thanks!!!!
Lovely

As the answer said uninstall python and reinstall with "Install for all users" option ticked
During installation
will it make my bot get lost?
i installed python but am using Pycharm, should I delete pycharm?
that doesnt work
show code + your desired outcome + the "doesnt work" thing
No
Just uninstall python
I want it to display the time it was deleted```py
@bot.event
async def on_message_delete(message):
embed=discord.Embed(title=f"Message Deleted", color=discord.Colour.blue())
embed.add_field(name=f"Member", value=f"{message.author.mention}")
embed.add_field(name=f"Message Content", value=f"{message.content}")
embed.add_field(name=f"Channel", value=f"{message.channel.mention}")
embed.set_author(name=f"{message.author.name}#{message.author.discriminator}", icon_url=message.author.display_avatar.url)
embed.set_footer(text=f"Message ID: {message.id} | {datetime.utc.now()}")
channel = bot.get_channel(975795336570363925)
await channel.send(embed=embed) ```
Show your imports
rip
!d datetime.datetime.utcnow
classmethod datetime.utcnow()```
Return the current UTC date and time, with [`tzinfo`](https://docs.python.org/3/library/datetime.html#datetime.datetime.tzinfo "datetime.datetime.tzinfo") `None`.
This is like [`now()`](https://docs.python.org/3/library/datetime.html#datetime.datetime.now "datetime.datetime.now"), but returns the current UTC date and time, as a naive [`datetime`](https://docs.python.org/3/library/datetime.html#datetime.datetime "datetime.datetime") object. An aware current UTC datetime can be obtained by calling `datetime.now(timezone.utc)`. See also [`now()`](https://docs.python.org/3/library/datetime.html#datetime.datetime.now "datetime.datetime.now").
Warning
Because naive `datetime` objects are treated by many `datetime` methods as local times, it is preferred to use aware datetimes to represent times in UTC. As such, the recommended way to create an object representing the current time in UTC is by calling `datetime.now(timezone.utc)`.
is there an easy way to remove unicode characters from a string?
re.sub('Unicode regex pattern', string "")
i'd have to put every unicode pattern in existence
noone asked you to use datetime.utc.now()
its either .now() or utcnow()
So uninstall python, redownload it
Heyo, I've asked this here before but didn't really get a clear answer on it, but I'm wondering about how to do 2 things:
- In on_member_ban, I'm wanting to check if the user is in another server which the bot is in, and if they are, to have it kick them.
- In a slash command, have the bot send the response to another server.
I know that mutual guilds can be checked, I'm just not sure how to get specific or how to really go about doing it anything with that. Any help is greatly appreciated 
if ctx.author.id != ctx.message.author.id @brave forge
Yes and during installation check "Install for all users" box
i think that should do it iirc
re.sub(ur'[\u064B-\u0652\u06D4\u0670\u0674\u06D5-\u06ED]+', "", string) oughta do it
😂 you ctx.author is just ctx.message.author this will never be True
its just doing 1 != 1
Well
Oh wait,!8 did that backwards
ctx should be interaction in this case
String comes last
this will help to make sure that only the mentioned participant can click on the button
so if the person interacting is not equal to the message author
they need to have different names then~
Ik this may not be relevant..
How do i use a color for an embed text e.g
interaction.user.id != ctx.author.id
Some libs have ctx as interaction by default
still.... having ctx on both sides doesnt makes sense.
that's how it is within the interaction though, interaction will have message as a attribute
- ?
- lemme check I don't really remember
Did it work?
I'm on mobile
Ok ok I’ll keep you updated
Yeah how do i set it?
That works
```diff
- your message
you have interaction as your thing not ctx..
@tough lance which python should I download
also thanks for this
The original one 3.10
ok ok
Of course
i pretty sure there is a different utc datetime that most libs what you to use, like a utc aware datetime
lemme see
But still that guy was getting attributes wrong
nope, i can't find it
He was doing datetime.utc.now()
How do i include an Argument into a command error?
how can my bot send the server avatar of a user?
Wdym by "click" 
Normally you get args based on the error as the parameter of your error instance
The error argument in the on_error is nothing more than the object of the error raised, so it is an instance of a class
!d discord.ext.commands.BadArgument
exception discord.ext.commands.BadArgument(message=None, *args)```
Exception raised when a parsing or conversion failure is encountered
on an argument to pass into a command.
This inherits from [`UserInputError`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.UserInputError "discord.ext.commands.UserInputError")
For example if you open the docs you will see what method and params bad argument has, if your error is an instance of bad_argument it will have all that params and methods
It means what do you mean?
What do you mean by "click"?
It can be anything, a reaction, a button, different object has different handlers
And one advise: english is essential for programmers, it is not an option
...
if ctx.author.id != ctx.message.author.id:
await interaction.response.send_message(f'**{ctx.author.mention}** занялся сексом с **{member.mention}**')
button1.callback = button1_callback```
? розмовляй по укр ок?
а то я тебе не розумію
О
Угу
Что нужно?
ur black af
!rule 4 please
4. Use English to the best of your ability. Be polite if someone speaks English imperfectly.
Excuse me, what?
For moderation purposes, we request all communication on server to be in english
geometry dash is a cool game
You just hate russians
you think the war is their fault
Please respect channel topics.
And what do any of your messages have to do with that topic?
What?
It's not about the language itself, but due the fact that the Moderators & Admins need to fulfill their staff duties, which may create complications if it's in another language. It's pretty sinmple, besides that it's getting really off-topic
Its a server rule, we request everyone to write in english so we can moderate effectively. You did agree to those rules when you joined
This isn't an American server, its a worldwide membership.
Anyways, this is off-topic for this channel. If you have further questions regarding our rules and policies you can ask in #community-meta
Yes "engrish" isn't a language
Check if the user that clicked the button is the author
What lib are you using
Try asking in their support server
no
that isn't how you do it
class v(disnake.ui.View):
@disnake.ui.button(label="hello", style=disnake.Style.green)
async def callback1(self, button: disnake.ui.Button, inter: disnake.Interaction):
# do stuff```
a call back returns the button AND an interaction
@brave forge there u go
!d discord.Interaction I so have to take a look at this
class discord.Interaction```
Represents a Discord interaction.
An interaction happens when a user does an action that needs to be notified. Current examples are slash commands and components.
New in version 2.0.
I don't like how it's different from Context
no
View subclass outside of everything
buttons in View subclass
you can access v anywhere
you can use it everywhere and anywhere
you just create an instance like this v()
you can save it like
vinstance = v()
or just use it in your command directly
await ctx.send(view=v())
or whatever your class is called
well that's a bit more complicated
I would pass the user who invoked the command to the class
take the user in your __init__
check if interaction.user == member in your callback
example:
class v(disnake.ui.View):
def __init__(self, member):
self.member = member
@disnake.ui.button(label="hello", style=disnake.Style.green)
async def callback1(self, button: disnake.ui.Button, inter: disnake.Interaction):
if interaction.user == self.member:
# do stuff
@bot.command()
async def hello(ctx):
await ctx.send(view=v(ctx.author))
lol a cool hack i made
async def temp_mute_channel_member(
channel, member, duration, reason): ...
discord.abc.Messageable.temp_mute_member = temp_mute_channel_member
discord.Message.temp_channel_mute_author = property(
lambda self: partial(
self.channel.temp_mute_member, self.author
)
)
discord.ext.commands.Context.temp_channel_mute_author = property(
lambda self: self.message.temp_channel_mute_author
)
There's no need to be rude
so I'm dumb because of missing python knowledge? 😭
day to day I'm gaining interest to help rather in the discord.py server
or just not
just leave it
I have not seen anything from them that seems toxic. If anything, it is your own behavior.
@novel apex is always available for reports if I or any other mod missed something
what do i have to import/install for buttons? idk and confused
since you cant speak other languages besides english in this server, which theres nothing wrong with
what?
yup thats the exact reaction mods had
you do know english isnt the only language Americans speak right?
Not every american speaks english
yup
bro keep on topic
i ment America as the continent and not the united states lmfao
go to general or sum if youre gonna argue
you can just make a command and pass the argument to a class
if you dont mind telling me what do you have to import for buttons/install?
which you can make the View subclass outside of the cog
D:
okimii we have like the same minds
meh already gave you an example😅
broo someone answer my question please
ofc I did
discord.py already has buttons
inside discord.ui
yes but whats the import message
using discord.ui for some reason on pycharm doesnt work :/
the folder or the dir?
from discord import ui? Idk you can access it anyway
do you have main?
wym
do you have dpy 2.0/master/main
holdup its magically not giving an error
😅
thats odd anyways thanks ig
if its through the class room how didnt it reached you?🤔
why is this happening? my cog was fine beforehand i added buttons
It might be time to take a short break, you seem to be frustrated
lol
it seems like a break would be the best option for him
it's cuz you updated dpy
the setup function now has to be async
ah so async bot.add_cog?
async def setup(bot):
await bot.add_cog(Cog(bot))
oh okay thanks
Cursing at them will not help
Where's the exact problem?
its kinda basic oop lmao
This is like the fourth time or so that they've been rude to the people trying to help
Or at least from what I've seen
wait do i just replace this with bot.add_cog in main.py or in the the cog? 😅
If they think that does help them, let it be 
this is in the cog
in the main file, you also have to await bot.load_extension()
https://discordpy.readthedocs.io/en/master/migrating.html Read this to help migration to master
what would that be?
It lists all the breaking changes
Alright, do you know how to make a basic button? Which does only take the Button press from the author? If yes, just reverse it, don't check for the author, but for the mentioned User.
this was in my main file before the update:
for extension in os.listdir("cogs"):
if extension.startswith("cog"):
try:
bot.load_extension(f"cogs.{extension[:-3]}")
except commands.errors.ExtensionAlreadyLoaded:
bot.reload_extension(f"cogs.{extension[:-3]}")
print(f"Loaded {extension[:-3]}")
now it's
@bot.command()
async def load_cogs(ctx):
for extension in os.listdir("cogs"):
if extension.startswith("cog"):
try:
await bot.load_extension(f"cogs.{extension[:-3]}")
except commands.errors.ExtensionAlreadyLoaded:
await bot.reload_extension(f"cogs.{extension[:-3]}")
print(f"Loaded {extension[:-3]}")
edited
what
what
because it could've been a fork other than dpy 2.0
There are 3rd party libraries, if it's such a "stupid" question why don't you read the docs to understand how buttons work? It's pretty easy for me, but did I mention that it's a "stupid" question? Honest question: are you trolling?
5th time now
How do I put words about me in the bot?
why even question the people trying to help you? we're here because we've gone through these stuff and we won't ask you questions that don't make sense
You do it in the developer portal
You can do that in the developer Portal
there are plenty examples on github
I dont think that the docs are that bad, but still if you think they are bad let me atleast try to help you, instead of getting aggressive towards me.
Why don't you switch to d.js then?
If your more familiar with djs why not use it instead
why dpy then
lmao
choose discord.js, the language is easier, it's faster, the documentation is better, the helpers are better
I recommend learning object oriented programming if we're in it
but you just said the documentation is easier for you to read, so why not continue learning Javascript instead of being mentally frustrated asking other people for help?
And to be fair, djs is far more advanced than dpy
They got some good stuff in there
Yeah it definetly is
djs has voice receiving bro I'm switching rn
lmao
Their developer community is pretty good as well
Their repo is very professional from the looks
Mmm conventional commits
how do i make grp commands in d.py v2 (hybrid cmds)
@commands.hybrid_group()
async def test(self):
...
# how do i call the next one?
# just @test.command?
well that's a good question
Correct you do @test.command
()
Yeah, but then don't be that aggressive. I don't even want to say that you have anger issues or anything else, maybe you even have your own mental problems that do give you reasons to switch into such mood that fast. Just try to let people help you, and dont insult them if they are actually trying to help you. It really isn't poductive. Anyways I'm out for today, I wish you a nice evening/day
!d discord.ext.commands.HybridGroup.command
@command(*args, **kwargs)```
A shortcut decorator that invokes [`hybrid_command()`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.hybrid_command "discord.ext.commands.hybrid_command") and adds it to
the internal command list via [`add_command()`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.HybridGroup.add_command "discord.ext.commands.HybridGroup.add_command").
but it gave me this error:
TypeError: Command signature requires at least 1 parameter(s)
Give it another parameter then
like?
what's in your async def something()
Not sure, but a place holder?
self
idk
Prob ctx
you just have to have something after self
variable naming is not important
what the variable contains is important
alright i passed in inter
before anyone bites my head off, it just doesn't change the outcome
ok that seems to resolve it
Off-topic channel: #ot2-never-nester’s-nightmare
Please read our off-topic etiquette before participating in conversations.
here you can talk about the Russian language 
4. Use English to the best of your ability. Be polite if someone speaks English imperfectly.
I didn't say you have to do it in Russian
Yeah at this point it just seems to be non sense trolling tbh, I won't answer anything of this from this point on. If you do have coding related questions, feel free to ask them in here, and let anyone who is able to help you, try to help you if you really need it.
ok and?
exactly
having more cuss words in a language isnt good either
if you think thats good then you're wrong
I think this has run its course
Well, every language has the same cuss words in the end, but that's not a suitable topic for this channel
Lets please move on
surely has
And remember, @novel apex is always accepting reports.
at this point he should be warned once, everytime he gets mad he brings in russian things
I'm this close 🤏
Let's just ignore it from now on if it's not related to the channel, and the problem is solved.
I have to run, which is why I'm mentioning it
@velvet compass
give me mute for 30 minutes
Why? Just avoid the server for 30 minutes and use some self control
In my logging should I log thread events in the same channel as channel events or in separate channels
That's a design choice and up to you
yeah ik but i'm really indecisive so I want to know how others would like as the end user
Are the message IDs for a particular channel in a consecutive sequence?
imo yes
Personally I'd like that the bot let me customize it
!d discord.TextChannel.history, sorry i read the question wrong
async for ... in history(*, limit=100, before=None, after=None, around=None, oldest_first=None)```
Returns an [asynchronous iterator](https://docs.python.org/3/glossary.html#term-asynchronous-iterator "(in Python v3.10)") that enables receiving the destination’s message history.
You must have [`read_message_history`](https://discordpy.readthedocs.io/en/master/api.html#discord.Permissions.read_message_history "discord.Permissions.read_message_history") permissions to use this.
Examples
Usage...
use this, and use .id property on the iterable elements
What is the problem
no they are not, each message on discord has a specific ID and they are not in order.
YES
remove the $
try to do it in cmd as ‘py -m pip install…’
the bot will offer some level of customisation. the bot is storing a mandatory default logging channel, and then optional logging channel for each type of event, if there is a channel for that event then it will use that channel but if not it will use the default logging channel. in the case of threads I was wondering if I should add in a specific channel for thread events bc then the bot will be checking if it has the thread events then the channel events then the default log
message_content is a 2.0 thing and its available only on github, not pypi
either you didnt install libraries or chose diff interpreter w no libraries ig
try to switch it by ctrl shift p
thats replit and it usually chooses what to install itself.
It didn’t work….
!eval
print("hello world!")
@glacial echo :x: Your eval job has completed with return code 1.
001 | File "<string>", line 1
002 | print("hello world!")
003 | ^
004 | SyntaxError: invalid non-printable character U+200B
Unable to create process using C:\Users\USER\AppData\Local\Programs\Python\Python310\python.exe
C:\Users\USER\PycharmProjects\pythonproject\venv\main.py
HELP
folder structure please
wdym
drag and drop?
!eval print("Hello, world!")
it’s not fuckinf OWEKSK
U
Are sex
Help
how to move a file is like the most basic thing ever?
It won’t get out of the venv direction yet
IT WONT FUCKING MOVE
what have you even tried? nothing?
Listen, there’s no need to be patronising- I’m asking for help and you volunteered to help, but I don’t appreciate you trying to make me feel bad about myself. If you want to help me then go on, but no snarky remarks
well, this is a help channel for discord bots and you're asking how to move a file.
This isn't very relevant to the channel, a help channel can be used for this
Well the question was about a bot.
it’s ok I’ll figure it out on my own or ask someone else
Just because you're doing whatever this is inside of a bot does not make it discord bot related...
"i have a toaster in my house, do i ask a carpenter how to fix it?"
What is the best/cleanest way to do something when a button is clicked ? I've seen several examples using different solutions (callback, on_button_click but I think it's not from discord.py)..
How are u making the button
By using
buttonName = Button()
I would subclass it (if ur not already doing that) and create an async method named callback with one argument interaction
In python how do you get the bot to say the guild name? I'm sort of new to coding
ayo what i do wrong
I think that's what I am going to do yeah, just wanted to check if they were not another way to do I missed
it looks like there is some syntax error, can you paste the code here
@client.event
async def on_command_error(ctx, error):
if isinstance(error, commands.CommandOnCooldown):
em = discord.Embed(title=f"**Wait a little bit lmao**",description=f"Try again in `{int(error.retry_after/60)}` minutes.", color=discord.Colour.red())
await ctx.send(embed=em)
if isinstance(error, commands.CommandInvokeError):
await ctx.reply("You don't have a profile, use .start to create one!")```
its unindented further than the start of the function is indented
yeah it did
Your indentation is off, you mix spaces and tabs and set them to different widths?
uh i tried typing {guild.name} and {message.guild.name} but it doesn't work, this is like my 2nd week of learning python sorry
where do you use it? did you remember to use f-string? f"{something.here}" instead of just "{something.here}"
if it's inside of bot command, it's probably f"{ctx.guild.name}"
thank you
can someone redirect me to docs for discordpy where i can see how to work with threads, i cant find it.
!d discord
In order to work with the library and the Discord API in general, we must first create a Discord Bot account.
Creating a Bot account is a pretty straightforward process.
click the title for the docs for v2
Thanks
Those are disnake docs.
Those aren’t the same as dpy docs.
Dpy 2.0 docs can be found here https://discordpy.readthedocs.io/en/master/
class discord.Client(*, intents, **options)```
Represents a client connection that connects to Discord.
This class is used to interact with the Discord WebSocket and API.
A number of options can be passed to the [`Client`](https://discordpy.readthedocs.io/en/latest/api.html#discord.Client "discord.Client").
but other things are up with discord.py
eh i couldnt find much in the dpy docs site that i had so, i just shifted to disnake lol
i am just starting to learn, it was gonna be dpy, now its disnake
have fun I guess.
disnake's docs seem more user friendly tbh
they are 90% same
The front page is the only difference.
welp, guess i will jump right into it
fair
The api ref is ripped right out of dpy
they are seperate forks
Traceback (most recent call last):
File "C:\Users\David Powell\AppData\Local\Programs\Python\Python310\lib\site-packages\disnake\ext\commands\common_bot_base.py", line 418, in _load_from_module_spec
spec.loader.exec_module(lib) # type: ignore
File "<frozen importlib._bootstrap_external>", line 883, in exec_module
File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
File "C:\Users\David Powell\PycharmProjects\WhiskeyBotMain\cogs\events.py", line 14, in <module>
class events(commands.Cog):
File "C:\Users\David Powell\PycharmProjects\WhiskeyBotMain\cogs\events.py", line 57, in events
async def ping(self):
File "C:\Users\David Powell\AppData\Local\Programs\Python\Python310\lib\site-packages\disnake\ext\commands\slash_core.py", line 663, in decorator
return InvokableSlashCommand(
File "C:\Users\David Powell\AppData\Local\Programs\Python\Python310\lib\site-packages\disnake\ext\commands\slash_core.py", line 357, in __init__
options = expand_params(self)
File "C:\Users\David Powell\AppData\Local\Programs\Python\Python310\lib\site-packages\disnake\ext\commands\params.py", line 690, in expand_params
raise TypeError(f"Couldn't find an interaction parameter in {command.callback}")
TypeError: Couldn't find an interaction parameter in <function events.ping at 0x000002A387C925F0>
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "C:\Users\David Powell\PycharmProjects\WhiskeyBotMain\wb.py", line 39, in <module>
bot.load_extension('cogs.events')
File "C:\Users\David Powell\AppData\Local\Programs\Python\Python310\lib\site-packages\disnake\ext\commands\common_bot_base.py", line 490, in load_extension
self._load_from_module_spec(spec, name)
File "C:\Users\David Powell\AppData\Local\Programs\Python\Python310\lib\site-packages\disnake\ext\commands\common_bot_base.py", line 421, in _load_from_module_spec
raise errors.ExtensionFailed(key, e) from e
disnake.ext.commands.errors.ExtensionFailed: Extension 'cogs.events' raised an error: TypeError: Couldn't find an interaction parameter in <function events.ping at 0x000002A387C925F0>
code
@commands.slash_command(name="ping",description='Check Bots Latency')
async def ping(self):
bot.get_command("ping").invoke
you need to have one arguement interaction
thank you
also how do i push slash commands in disnake to a test guild
@disnake.ext.commands.slash_command(*, name=None, description=None, dm_permission=None, default_member_permissions=None, options=None, guild_ids=None, connectors=None, auto_sync=None, extras=None, **kwargs)```
A decorator that builds a slash command.
guild_ids kwarg
Ignoring exception in slash command 'ping':
Traceback (most recent call last):
File "C:\Users\David Powell\AppData\Local\Programs\Python\Python310\lib\site-packages\disnake\ext\commands\slash_core.py", line 585, in invoke
await call_param_func(self.callback, inter, self.cog, **kwargs)
File "C:\Users\David Powell\AppData\Local\Programs\Python\Python310\lib\site-packages\disnake\ext\commands\params.py", line 678, in call_param_func
return await maybe_coroutine(safe_call, function, **kwargs)
File "C:\Users\David Powell\AppData\Local\Programs\Python\Python310\lib\site-packages\disnake\utils.py", line 555, in maybe_coroutine
return await value
File "C:\Users\David Powell\PycharmProjects\WhiskeyBotMain\cogs\events.py", line 62, in ping
self.bot.get_command("ping").invoke()
AttributeError: 'NoneType' object has no attribute 'invoke'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "C:\Users\David Powell\AppData\Local\Programs\Python\Python310\lib\site-packages\disnake\ext\commands\interaction_bot_base.py", line 1346, in process_application_commands
await app_command.invoke(interaction)
File "C:\Users\David Powell\AppData\Local\Programs\Python\Python310\lib\site-packages\disnake\ext\commands\slash_core.py", line 594, in invoke
raise CommandInvokeError(exc) from exc
disnake.ext.commands.errors.CommandInvokeError: Command raised an exception: AttributeError: 'NoneType' object has no attribute 'invoke'
@commands.command(name="ping")
async def ping(self, ctx: commands.Context):
await ctx.send(f"Pong! {round(self.bot.latency * 1000)}ms")
@commands.slash_command(name="ping", description='Check Bots Latency', guild_ids=guild_ids)
async def ping(self, interaction):
self.bot.get_command("ping").invoke()
Hey!
Im getting this error
channel = await self.client.fetch_channel(int(channel_id_server_1)) AttributeError: type object 'menciones' has no attribute 'client'
Why am I getting this error?
def __init__(self, client: commands.Bot) -> None:
self.client = client
Here im defining client, this commands is inside a cog
And im calling the class from the main file
You sure that's where the error is?
Yeah it's probably something with importing the class
Just realised
So that's not really the problem
Im working on it
hrmm im stumped on this error.
What are you trying to do?
A slash command in what lib?
disnake
Ok so
yes. i am trying to get it to execute a command that is defined earlier in the cog so i dont need to duplicate my code
Basic slash command in Disnake
@commands.slash_command(name="Hello", description="Hello command")
async def hello_cmd(self, inter: ApiCommandInteraction):
await inter.send("This is the hellcommand!")
I think this is right
O Cogs
'ApiCommandInteraction' is not defined
Define it in the cogs imports??
huh? idk how to do that
That is basic Python?
ok... where do i define that lol. in the
import disnake
```or
```py
from disnake.ext import commands
or am i doing it in the completely wrong spot
cannot import name 'ApiCommandInteraction' from 'disnake.ext' (unknown location)
Oh
the basic command example they gave on the page was
@commands.slash_command(name="ping",description='Check Bots Latency')
async def ping(self):
bot.get_command("ping").invoke
Then try `APICommandInteraction
Well
Hmmmmmmmm
from disnake import ApplicationCommandInteraction
That is the import name
oops wrong code
import disnake
from disnake.ext import commands
bot = commands.InteractionBot(test_guilds=[12345])
@bot.slash_command()
async def ping(inter):
await inter.response.send_message("Pong!")
bot.run("BOT_TOKEN")
How aare you sending the slash?
same error
You need a way
hrmm? i dont understand
You need to define an interaction
umm this works wiht no issues
@commands.slash_command(name="ee", description='Check Bots Latency', guild_ids=guild_ids)
async def ping(self,inter):
await inter.response.send_message("Pong!")
but now i need to find how i can run a defined command via a slash command
so I can run $hello via /hello
i need to sleep
its late ill be back later
does anyone have a good alternative to heroku for pushing code to my discord bot
github has blocked usage to heroku
all those ones require money to use or reference heroku is there any other way for me to host
*ApplicationCommandInteraction
!d disnake.ApplicationCommandInteraction
class disnake.ApplicationCommandInteraction```
Represents an interaction with an application command.
Current examples are slash commands, user commands and message commands.
New in version 2.1.
Yeah I prefer nextcord
!d nextcord.Interaction
class nextcord.Interaction```
Represents a Discord interaction.
An interaction happens when a user does an action that needs to be notified. Current examples are slash commands and components.
New in version 2.0.
Way easier in terms of Typing
lol
I haven't coded a bot in like 6 weeks
!d disnake.Interaction
class disnake.Interaction```
A base class representing a user-initiated Discord interaction.
An interaction happens when a user performs an action that the client needs to be notified of. Current examples are application commands and components.
New in version 2.0.
its quite helpful with context managers
yep
async def on_message(message):
blacklist_wrds = ["word"]
for word in blacklist_wrds:
if word in message.content:
await message.channel.send("No naughty words!")
await message.delete()
await bot.process_commands(message)
is there a way to add smth to this so that it includes caps lock too and its not case sensitive?
message.content.lower()
message.content.lower()
Dang you beat me
well you used backticks so we'll call it even
oh where do i putt that in?
If statement
if word in message.content.lower():
?
you should be able to figure out how to use that for what you want
ohh
Yep
tysm
just a vague question, is it difficult to code a bot thats like ticket tool?
Depends on yr experience
how much experience would I need
U can't really measure experience-
is it better if I say like, what would I need to know in order to code a bott with a ticket system
Since how many months have u been coding in Python?
Not much, I've basically just started
Im just curious like roughly how long it will take me
U need to know bot commands, database, how to close channels with message triggers/commands and how to manage channels, along with some basic understanding of how the lib works
Uh, 2 years now
are you able to code a bot with a ticket system?
Uh, I don't like where this is going...
wdym
But yea
Ok you didn’t ask him to code it, good
Hell no I would never lmao
That's what I thought they would say haha
lmao I'm just trying to learn how to code
!resources are a great way to start!
The Resources page on our website contains a list of hand-selected learning resources that we regularly recommend to both beginners and experts.
sick, thx
How do I put role id in here?
some_role = #role id
@commands.has_role = (some_role)
The format of the id is <@& some number here >
@commands.has_role(some_role)
@commands.command(...)
async def cmd(...):```
I just put some_role into that?
Like this?
some_role = <@&1234567890>
@bot.command(name = "test", help = "test")
@commands.has_role(some_role)
"""Description of test"""
async def test(ctx):
await.....
I think just the id
The number?
Yes
I will try
It didn't work
Can we make a discord bot which changes its code according to the commands?
Like: !add-code print("Hello")
@fleet sand how well do you know python
You mean code evaluator?
!d exec
exec(object[, globals[, locals]])```
This function supports dynamic execution of Python code. *object* must be either a string or a code object. If it is a string, the string is parsed as a suite of Python statements which is then executed (unless a syntax error occurs). [1](https://docs.python.org/3/library/functions.html#id2) If it is a code object, it is simply executed. In all cases, the code that’s executed is expected to be valid as file input (see the section [File input](https://docs.python.org/3/reference/toplevel_components.html#file-input) in the Reference Manual). Be aware that the [`nonlocal`](https://docs.python.org/3/reference/simple_stmts.html#nonlocal), [`yield`](https://docs.python.org/3/reference/simple_stmts.html#yield), and [`return`](https://docs.python.org/3/reference/simple_stmts.html#return) statements may not be used outside of function definitions even within the context of code passed to the [`exec()`](https://docs.python.org/3/library/functions.html#exec "exec") function. The return value is `None`.
Not a good idea to just use this
Not so well
!d discord.ext.commands.has_role it takes an integer or a string; a role id or a role name
@discord.ext.commands.has_role(item)```
A [`check()`](https://discordpy.readthedocs.io/en/latest/ext/commands/api.html#discord.ext.commands.check "discord.ext.commands.check") that is added that checks if the member invoking the
command has the role specified via the name or ID specified.
If a string is specified, you must give the exact name of the role, including
caps and spelling.
If an integer is specified, you must give the exact snowflake ID of the role...
I have tried the name of the role and it works
Cool
What I want is the role id
yes you
then add the role id......?
Huh?
Just the number right?
yes?
Invi char 👀
It didn't work too
meh, just use ** ** or _ _
ic
imagine this message getting logged as an updated message with its old and new contents
If it works with the name then why do u need the ID?
Nvm, reactions dont work here
Because I want to use the bot in two server
@discord.ext.commands.has_permissions(**perms)```
A [`check()`](https://discordpy.readthedocs.io/en/latest/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/latest/api.html#discord.Permissions "discord.Permissions")...
!d discord.Permissions
class discord.Permissions(permissions=0, **kwargs)```
Wraps up the Discord permission value.
The properties provided are two way. You can set and retrieve individual
bits using the properties as if they were regular bools. This allows
you to edit permissions...
How about two roles with the same name but different permission?
how do you differ between both the roles then... ..
Check this doc if you don't know what's the permission's name
Id?
You sure you put it without quotes
Wait... role id need quotes?
No
Let me try
No
imagine copying both the roles ids to your clipboard, pasting then and remembering which id is which role's, then opening the role menu again to assign roles
Just name the ids
no comments
Also hello ashley
I use dotenv
How is that related to what ashley said
You don't put role id with quotes
What is your current code now
guild_role_guildofficer = os.getenv(GUILD_ROLE_OFFICER)
@bot.command(name = "nodewar", help = "Command for Node War announcement. Permission: Guild Officer and above.")
@commands.has_role(guild_role_guildofficer)
async def nodewar(ctx, role: discord.Role, input_time, *, message):
"""
• parameter 1 = ctx or the name of the command which is "nodewar"
• parameter 2 is role for which this announcement is targetted
• parameter 3 is time for nodewar
"""
time_format = "%H%M"
event = datetime.strptime(input_time, time_format)
channel = bot.get_channel(guild_channel_announcement)
embed = discord.Embed(
title = f"Announcement: Node War",
description = f"Tonight we will be having a Node War at __**{event.strftime('%-I.%M %p')}**__ server time.\n\n{message}\n> • We will take note on member attendance.\n> • Please join voice-chat on our discord.\nIf you can't join our Node War, please apply at <#{guild_channel_leave_application}>.\nThank you for your attention.",
color = 0xFFFF00,
timestamp = datetime.utcnow())
embed.set_footer(text = f"{ctx.message.author.name}")
await ctx.message.delete()
await channel.send(f"Dear {role.mention}", embed = embed)
@nodewar.error
async def announce_error(ctx, error):
if isinstance(error, commands.MissingRole):
await ctx.message.delete()
await ctx.send("You don't have permission to use this command!", delete_after = 3)
elif isinstance(error, commands.error.RoleNotFound):
await ctx.message.delete()
await ctx.send("The command is .nodewar guild_role time_of_nodewar\nFor example:\n> .nodewar Alibaba 1700", delete_after = 5)
else:
raise error
Eh?
Is that only one role?
I want to add another too, but I will work on this first
Any error?
It hits missing role
What
The error is MissingRole
No, I have the role to use the command
Hi cutie
😳
When @commands.has_role is the name of the role like ```("Guild Officer"), it works.
But when I want to use role id on @commands.has_role it goes to error and told me "You don't have permission to use this command!"
You sure it's the right id?
Check it again
Ofc it's the right id
Okay then paste the id here
Copy the role id again and paste it here
Usually it's human error
Rather than machine error
How about role id of the mods here?
...
<@&831776746206265384>
I just show you I know how to find role
._.
pwease
No
That's the moderators role id
Here
who stores ids in an env in the first place
and the reason it isnt working
is because everything in an env is of str type
and has_role accepts an integer
fwiw that still pings
I know, sorry for the trouble
I will try to convert it
lmao
Lmao knew it
Just do int() 😐
welcome.....
and if I may ask, why the heck are ids stored in an env....
So I can give people my bot then they will need to costumize it to their own server
uh...fine
Through editting .env
😔 rip bot variables
It just channel ids and role ids
They ain't good
They are set to default (cleared) on restart
Same I use globals
....I didnt mean that
instead of loading an env in every cog rather load it in the main file, and use botvars
thats my point
Who is senjan I've never seen him before.
I have been a prey to the same error before 
Mod since a LONG time
Explains the wot
and a wastage of resources
Wait, storing id in env is bad?
Ashley gonna get mad now
I store some ids there, some are not meant for someone else's eyes.
@cloud dawn gimme the ID, I am gonna hack the server =D
its not bad.....but the role ids are literally public, rather store sensitive information in an environment variable
Application id, client id etc
Token? 👀
Token is a must
So for two server, I need to rewrite my code and just put channel ids andr role ids there?
Or you make it dynamically, what you imo should have done in the first place.
uhhhh just do whatever you're doing, I'm not drowning myself knowingly
it will be just too much work anyways
plus a whole lot of errors
Dynamically?
Using a database, not using hardcode.
Regardless of what server or token it is using it should work.
You can't really "learn" it, if you just keep coding eventually things will fall into place.
You could get started with databases.
I'm using database to store members' info, I don't know about the "dynamically"
Oh, well it really depends on what you want to do too tbh.
At url i have to paste api? And at last Pokemon name?
import disnake
from disnake import ApplicationCommandInteraction as ACI
from disnake.ext import commands
from disnake.ext.commands import Bot
import os
import dotenv
dotenv.load_dotenv()
TOKEN = os.getenv("TOKEN")
bot = Bot()
@bot.event
async def on_ready():
print(f"Logged Into {bot.user}")
@bot.slash_command()
async def tl(inter: ACI):
msg = await inter.response.send_message("Spanish")
await inter.channel.create_thread(name="spanish", message=msg, auto_archive_duration=1440)
await inter.response.defer()
bot.run(TOKEN)
disnake.ext.commands.errors.CommandInvokeError: Command raised an exception: HTTPException: 400 Bad Request (error code: 20035): Guild premium subscription level too low
the error ^
its something about private threads needing a level 1 server
i believe auto archive is a premium only feature?
no
with boosts you can leave the thread open for longer
my duration is fine
but it tries to create a private thread
which is a premium feature
MAKING REQUESTS TO ANY API USING THE REQUESTS LIBRARY (BASIC)
#Generally used method
import requests
response = requests.get("https://www.api.com/endpoint")
content = response.json() #converting the response to json format since most APIs are based over json response types. NOTE - An API can also return images, html, etc...
#Now assuming the response as follows
'''
{
"main": {
"title": "response title",
"description" : "response description"
},
"external": "some other data"
}
'''
#now you can use dictionary methods to fetch the required keys from the response, an example is as follows
title = content["main"]["title"] #or (content["main"]).get("title")
print(title)
MAKING REQUESTS TO ANY API USING THE AIOHTTP LIBRARY (BASIC)
#Generally used for asynchronization
import aiohttp
import asyncio
#requests with aiohttp can never be made outside an async function
async def get_resp():
async with aiohttp.ClientSession() as session:
response = await session.get("https://www.api.com/endpoint")
#assuming same reponse type as discussed above
content = await response.json()
return content
print(asyncio.run(get_resp()))
This is probably not the right channel to tell such things, you might consider claiming a help channel #❓|how-to-get-help
try mongo
did you really type all that out
wow
seems like it
the person's been asking about requests to an api from the past day 😔 i kinda felt bad
lmao
Can't you get the user avatar like this anymore ?
asset = member.avatar_url_as(size = 128)
AttributeError: 'Member' object has no attribute 'avatar_url_as'
I' using py-cord development version(latest)
Member.avatar.url you have to use the method now iirc
🤡
I swear py-cord's docs dont even try to open
lol
use the with_size method on avatar.url
what does that do?
interesting
weird
oh wow
when did they even add it
i just tried it out
its cool
a bot template
a cogs folder, bot.py and a .gitignore
and bot.py has
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from discord.ext import commands
import discord
import config
class Bot(commands.Bot):
def __init__(self, **kwargs):
super().__init__(command_prefix=commands.when_mentioned_or('$'), **kwargs)
for cog in config.cogs:
try:
self.load_extension(cog)
except Exception as exc:
print('Could not load extension {0} due to {1.__class__.__name__}: {1}'.format(cog, exc))
async def on_ready(self):
print('Logged on as {0} (ID: {0.id})'.format(self.user))
bot = Bot()
# write general commands here
bot.run(config.token)
you can disable those
My brain hurts from pandas and excel when i sort data everything is fine but then smaller number randomly sneak in
extra options
oh
i see
Maybe now people will stop working with bot instance called "client"
lol
@slate swan i tried you code it sent me all information in form of json
How can I get information in form of discord embed
yea the endpoint will go there and then just print the response json to see if it has the name or not, if it got that use json_response.get("name")
with open('./image/match1.jpg', 'wb') as handler:
handler.write(await members.avatar.read)
with no error but windows says its corrupted im trying to replace my old requests way of getting pfps
what is the best way to safe id's?
Umm guys how can i fix this problem?
ImportError: cannot import name 'PartialMessageable' from 'discord.channel'
How can I get it using embed in discord
when i launched the bot this will it say
how can i fix this??
!d discord.chanenl
it doesn't exist
!d discord.channel.PartialMessageable
class discord.PartialMessageable```
Represents a partial messageable to aid with working messageable channels when
only a channel ID is present.
The only way to construct this class is through [`Client.get_partial_messageable()`](https://discordpy.readthedocs.io/en/latest/api.html#discord.Client.get_partial_messageable "discord.Client.get_partial_messageable").
Note that this class is trimmed down and has no rich attributes...
tf
channel.py is a file inside discord package
!d discord.channel.PartialMessageable
class discord.PartialMessageable```
Represents a partial messageable to aid with working messageable channels when
only a channel ID is present.
The only way to construct this class is through [`Client.get_partial_messageable()`](https://discordpy.readthedocs.io/en/latest/api.html#discord.Client.get_partial_messageable "discord.Client.get_partial_messageable").
Note that this class is trimmed down and has no rich attributes...
huh
why do you think some one would document about a file?
just like you do for any other normal text
because they are chads
discord.py? chads?
doesnt go well in a single statment.
aaww
hello im trying to use aiohttp for the first time could i get some help
async with aiohttp.ClientSession() as cs:
async with cs.get(f"https://cdn.discordapp.com/emojis/{i}.png") as r:
emojis = await r.read()
await cs.close()
await ctx.guild.create_custom_emoji(name=emojinames[coot], image=emojis)
output
Command raised an exception: ValueError: Unsupported image type given
!d discord.Emoji.read
await read()```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).
Retrieves the content of this asset as a [`bytes`](https://docs.python.org/3/library/stdtypes.html#bytes "(in Python v3.10)") object.
ahhh okay my bad
just bot.get_emoji(id) and use the read method
the emojis its being given are emojis which arent in the same server as the bot
so would that still work?
👀
I've started the auto_help project 
Me not able to understand and is your api rapper good so I'll use it if it's easy



