#discord-bots
1 messages · Page 939 of 1
hindi
alr i'm cool with it
really
does anyone know whats this causing this error?
only happens when i try running the bot locally
edit: re-installing the library worked
GG
i did a cog and it shows this error
NoEntryPointError: Extension 'cogs.basic' has no 'setup' function.
what does that mean and how do i fix it
add this
def setup(bot:commands.Boy):
bot.load_extestion(Basic)
which api should I use for covid data
oh ok thx
what about this one
def setup(bot):
bot.add_cog(mod(bot))
it's good
so that also works?
yup
but it still shows error
ive been using that before but when i run it today it shows that
hello, is it possible to run command on_ready?
well yes
it "is" but you shouldnt
yeah ^ i don't know why you'd want to do it on_ready
i mean unless you wait wait_until_ready() or something i guess
!d discord.ext.commands.Bot.invoke
await invoke(ctx, /)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).
Invokes the command given under the invocation context and handles all the internal event dispatch mechanisms.
Changed in version 2.0: `ctx` parameter is now positional-only.
what...
why?
the event itself waits for the bot to ready up
dunno why you would want a wait_until_ready
well basically I have an interaction and when I rerun the app it destroy. So what I want to do is re send the component on startup. Is there a possible way to return the interaction from the existing component?
you can store the id and channel id of the message and use them to fetch the message
nvm i made it work. tysm for this
@bot.command(name="start")
async def start(ctx):
guild = ctx.guild
admin_role = guild.get_role(945847161596297277)
overwrites = {
guild.default_role: discord.PermissionOverwrite(view_channel=False),
ctx.author: discord.PermissionOverwrite(view_channel=True),
admin_role: discord.PermissionOverwrite(view_channel=True),
guild.me: discord.PermissionOverwrite(view_channel=True)
}
channel1 = await guild.create_text_channel(f"private-channel{ctx.author}", overwrites=overwrites)
await channel1.send("Hi! for help on how to order, do !help", mention_author=True)
await ctx.message.delete()
```
command start not found. HUH?
is that what your error handler said?
yup but now im gettring a new errow without changing anything
ill send the fukll error
Ignoring exception in command start:
Traceback (most recent call last):
File "C:\Users\trent\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\ext\commands\core.py", line 85, in wrapped
ret = await coro(*args, **kwargs)
File "c:\Users\trent\Desktop\DiscordBot\discordbot.py", line 147, in start
channel1 = await guild.create_text_channel(f"private-channel{ctx.author}", overwrites=overwrites)
File "C:\Users\trent\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\guild.py", line 948, in create_text_channel
data = await self._create_channel(name, overwrites, ChannelType.text, category, reason=reason, **options)
File "C:\Users\trent\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\guild.py", line 844, in _create_channel
'id': target.id
AttributeError: 'NoneType' object has no attribute 'id'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "C:\Users\trent\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\ext\commands\bot.py", line 939, in invoke
await ctx.command.invoke(ctx)
File "C:\Users\trent\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\ext\commands\core.py", line 863, in invoke
await injected(*ctx.args, **ctx.kwargs)
File "C:\Users\trent\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\ext\commands\core.py", line 94, in wrapped
raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: AttributeError: 'NoneType' object has no attribute 'id'
before it was this 🗿
discord.ext.commands.errors.CommandNotFound: Command "start'" is not found
whatever
get_ stuff returns None if not found
check if its none
wait ok
i think i know whats causing it
idk why tho
its the only thing ive changed
!paste
Pasting large amounts of code
If your code is too long to fit in a codeblock in discord, you can paste your code here:
https://paste.pythondiscord.com/
After pasting your code, save it by clicking the floppy disk icon in the top right, or by typing ctrl + S. After doing that, the URL should change. Copy the URL and post it here so others can see it.
error in line 145, i think i has something to do with the emebeds, since thats what i chnged last, any help would be much apricated https://paste.pythondiscord.com/agenemalef
how to change the avatar of my bot?
await edit(*, username=..., avatar=...)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).
Edits the current profile of the client.
Note
To upload an avatar, a [bytes-like object](https://docs.python.org/3/glossary.html#term-bytes-like-object "(in Python v3.10)") must be passed in that represents the image being uploaded. If this is done through a file then the file must be opened via `open('some_filename', 'rb')` and the [bytes-like object](https://docs.python.org/3/glossary.html#term-bytes-like-object "(in Python v3.10)") is given through the use of `fp.read()`.
The only image formats supported for uploading is JPEG and PNG.
Changed in version 2.0: The edit is no longer in-place, instead the newly edited client user is returned...
property user```
Represents the connected client. `None` if not logged in.
still, any help would be very welcpme
whats the error
@gaunt ice
target is None
!e print(None.id)
@slate swan :x: Your eval job has completed with return code 1.
001 | Traceback (most recent call last):
002 | File "<string>", line 1, in <module>
003 | AttributeError: 'NoneType' object has no attribute 'id'
is what you're trying to do
Non rly, I’m trying to make it so it creates a channel that allows the admin and creator of the channel to be the only ones that see it
what is target exactly?
For what part?
here
how the code should look?
iirc the property returns ClientUser so just do await bot.user.edit
for i in range(69):
The target is the bot, allowing it to see the channel @slate swan
youre right master
hmm doesn't work
yield from no
ok
That returns a list of users
yeah i made it singular
its singular sorry i made it plural 
🗿
@slate swan
how do you define target
I don’t think I’m understanding 😭 idk why this is happening I haven’t touched that code in a couple weeks

how to import the png because I get some errors when doing this

The only thing I added was changing some text into embeds, would that mess with the code here is an example
’’’py
bot.command(name = 'orderhelp')
async def ping(ctx: commands.Context):
channel = ctx.channel
emb=discord.Embed(title="Please list your order like this for the least confusion!",description=f"Poster(10 ref) or pfp(5 ref) \n Character \n Cosmetics \n Unusuals(if wanted +1 ref per) \n Weapons \n And any other requests! \n WHEN READY USE !ORDER")
await channel.send(embed=emb)
’’’
I can’t do it on mobile
^
Me?
yes
Ohh
oof
THAT MAKES SENCE SINCE I BASED IT OFF A WELCOME EMBED!
@bot.event
async def on_reaction_add(reaction,user):
print("aaaaa")
Ily
Im using that rn but it doest print aaaa
try on_raw_reaction_add with payload param
just payload?
yes
hey, idk if u remember me from yesterday
with open("/root/Textfiles/ongoing.txt", "r") as f:
if f.read().count(str(ctx.author)) > 1:
await ctx.send("**__Error__**\nMax timer limit reached.")
return
this one didnt work
i did an else statement, so if its not over 1 it still allows it, and it did allow it
Are you using the text file as a database?
json as database 💀
i am, but it works fine for me and its easier for me to keep track off
ok, but I would try to switch to a proper database in the future
in the future, maybe, im not good enough for that
You should do it asap cuz all of your issues are because of this
eh ill try to figure it out, but ik im not capable of switching yet
well with that attitude, you aren’t
if you don’t go out of your comfort zone, you’ll never get better
Search some SQL tutorials or check #databases pins
nah, this is not the time for motivation, i just know i cant.
im not trying to get pity or something lol
SQL is easy for basic functional
How to check if "someone" is a bot?
it has the 'BOT' tag next to it
if your_user_or_member_param is your_user_or_member_param.bot:
or if not your_user_or_member_param: to handle when the user isn't a bot
oh he meant it that way
no no no, I need to check if the members are a bot
@swift imp
A
know
I tried this and I got a strange error```py
@bot.command()
async def check(ctx, member: discord.Member = None):
if member is None:
await ctx.send('ping @member')
else:
if member.bot == True:
await ctx.send('Yes')
else:
await ctx.send('No')
Member "id of bot" not found
If I try to test the bot, then there will be this error. In other cases, the code works
okay
will change nothing, it is the same
is and == aren’t the same thing
Yup but if member is None it will not become a member object only because you added is
the type converter is not converting the parameter to a member object
well yeah
that's all
Same error (or I misunderstood something)
. if member is None:
await ctx.send('ping @member')
else:
if member.bot:
await ctx.send('Yes')
else:
await ctx.send('No')```
There you go
Looks a lot better. you can replace the top line with if not member as well
^
Be consistent
Discord removed him
is it hard to maintain a library such as forking dpy?
if not isinstance(member, discord.Member):
member=ctx.guild.get_member(member)
if member is None:
await ctx.send(f"can't find {member}")
return
With the addition of the occasional accepted pr.
This is just extra
wait that's not what I meant, i mean like if i were to fork dpy, would adding the new features be hard?
that is always useful when you use typeconverters .-.
Oh. I see what you mean.
I mean if you're familiar with discords api and it’s endpoints and know how to read the docs
You're pretty much set
dpy has all the http handling and stuff built in.
You just need to know how to use them
How to make a code that if I send a float it will change the value to an integer then send to me
async def number(ctx, amount):
await ctx.channel.send((int(amount)))```This is my code but when i typed `!number 9,2` it didn't say anything
amount: int in the function
does python automatically make 9,2 into 9.2?
Nope
yeah
I thought it was a typo lol
ye same
javascript might
Disgusting
javascript does alot of things
people still use normal equality over strict
BS
for i in ctx.guild.channels:
r = httpx.post(
'https://discord.com/api/v9/guilds/{}/channels/{}/webhooks'.format(ctx.guild.id,i.id),
headers=headers,
json={'name': 'Spex Loves You'}).json()
await ctx.channel.send("ok")
print(r['id'],r['token'])```
Why this isnt working pls help me out
3rd one makes no sense
Tf is !=!
not equal to not object im assuming
Plssss help me guyz

idk man
im just using my python logic
which doesnt even work on python
nobody helps me
hi

isnt payload.emoji == 🟪 ? ( if the reacted emoji is 🟪 )
yes
ye
but it doesnt recognize it
hi moai
== checks for equality
I know

what’s up
are you using on_raw_reaction_add?
yeah
Any body knows httpx?
nah mate sorry

I edited the code a bit to suit my needs and this error appeared (just like last time)...```py
@bot.command()
async def check(ctx, member: discord.Member = None):
if not isinstance(member, discord.Member):
member=ctx.guild.get_member(member)
await ctx.send(f"can't find {member}")
else:
await ctx.send(f"Find {member}")
return
are they in the server
Yes
@slim ibexthis command gives the same error as this one
you can just use ```py
if not member:
member=ctx.guild.get_member(member)
await ctx.send(f"can't find {member}")
if is member.bot
okay
is mass banning / banning multiple users with 1 command possible?
Use a loop
yes
use this to get the multiple members
invalid syntax
!d discord.ext.commands.Greedy
class discord.ext.commands.Greedy```
A special converter that greedily consumes arguments until it can’t. As a consequence of this behaviour, most input errors are silently discarded, since it is used as an indicator of when to stop parsing.
When a parser error is met the greedy converter stops converting, undoes the internal string parsing routine, and continues parsing regularly.
For example, in the following code:
```py
@commands.command()
async def test(ctx, numbers: Greedy[int], reason: str):
await ctx.send("numbers: {}, reason: {}".format(numbers, reason))
``` An invocation of `[p]test 1 2 3 4 5 6 hello` would pass `numbers` with `[1, 2, 3, 4, 5, 6]` and `reason` with `hello`...
if you don’t want to use greedy, you can use * and specify a parameter after it so that all remaining arguments fall into that arg
How do i create a discord webhook with httpx
from discord import Webhook, AsyncWebhookAdapter
import aiohttp
async def foo():
async with aiohttp.ClientSession() as session:
webhook = Webhook.from_url('url-here', adapter=AsyncWebhookAdapter(session))
await webhook.send('Hello World', username='Foo')```
thank you for this
What does this command do?
Client.remove_command('help')
Removes the help command
@swift imp httpx
Wdym by removing help command
Dpy comes with a default help command
@swift imp need help regarding thus
This*
If you want another command named help you have to remove the default one first
Ok, ty
for what purpose 
Sorry, i don't know
banning potential raiders
oh cool
Hello, where can I learn discord.py?
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.
ty
can anyone help me make a code in which ill type like !id (@tag a user) and it will reply with their discord id?
ok
idk how to start
bot.get_channel works too
why do u recommend people worse library than its alternatives?
its using old api version and the dev is incompetent
use disnake or even better hikari
you can't really say that, everyone has preferences
let them use what they want, don't force a library.
have you seen Danny's implementation of slash commands? u call it preference?
is 2.0 stable yet?
i want get_channel to return my custom channel type
i want to add methods to existing classes
i wouldnt have gotten any help from you anyway lol
people say tabnine has better completion but i use copilot too
so is there anyone knowledgeable in this channel who can help me?
have you forked it?
ive been using tabnnie too
at runtime
like. check if its a vc, category, text channel, announcement channel, nsfw, etc?
hm why not subclass bot and make your own method insteaed of overriding bot.get_channel
lets say channel.temp_mute_member
channel.timeout ?
so i could do get_channel(cid).temp_mute_member
cant you use that in 2.0.0
thats an arbitrary example
big words
which lin are you using?
lib*
disnake 2.4
eek
have you seen guild.timeout?
bro 😕
i know all of these, what is the command to find sb discord id tho?
i said it was an arbitrary example, i could add any other method
ah well
somebodys
The user’s unique ID.
not really
subclass
yes really
i can literally do ```py
def my_method(self):
...
discord.abc.Messageable.my_method = my_method
but im asking if theres an actually good-looking solution
that looks like "@" symbole thing 
didnt help
not really a method a method needs to be in a class
dont do it as it is, make sure you have an instance of the User object
channel parameter is that self
ew
self is just a name, it can be anything
nothing to share
argument naming
parameter*
you don't name your paramater but ok
since i define the func outside class, it makes sense, at least for me, to name param what it represents
is it possible to make warnings different on other servers? Type not global.
sqlite3
self in global scope doesnt make sense
never told you to give me a working code
how doesn't it make sense?
ur new here too?
yeah im new, youre still wrong tho
no comments if one would take that seriously
Guys let’s keep it civil please
doesnt feel right
this guy should be a comedian since hes so funny
store the guild ids with the user maybe or create tables for each guild
please learn the difference between paremeters and arguments
you said parameter naming when theres just one argument bro
💀 this guy
no
an argument goes inside the parameter
yes
why is this even going on lol
parameters are names, arguments are values
then you prove my point lmfao
Can we stop the bickering and keep it civil?
yes
thanks, please stop this, im just trying to get help and people are just so ignorant
ok no need for that comment?
Insulting / antagonizing the people trying to help you probably isn't the best strategy either
^
Y’all might want to chill before this channel gets locked
i asked how to add functionality to classes... how is that insulting
i think im just gonna leave i went here to help people here but im not sure anyone needs help
hi okimii
hi
@slate swansorry for getting onto you before
id = message.author.id
if message.content.startswith(".whatismyid"):
await message.channel.send("`ID`: " + str(id))
got the bot to find my id, but how can i make it find sb elses id
Tooru needs help
🗿
!warn @supple thorn This isn't being civil, please don't insult other people. change the topic
:incoming_envelope: :ok_hand: applied warning to @supple thorn.
Sad

i thought topic was literally help
🤔
read description
but it is a help channel
theres no such word as help in the desc
questions imply getting help
like forks

questions AND discussions

@copper quartz im sorry for pinging you but does the word questions include some kind of help?
what about.. discussions.
you left out the part where you're wrong.
🙂
you guys really need to ping an admin for a dumb question
How about we all just chill and stop throwing insults around
lets not waste their time
for now
If you are looking for dedicated help, #❓|how-to-get-help is the way to go. This channel is the 2nd busiest one in the server, and as such is poorly suited to get focused feedback on a problem. Also, don't ping individual staff members.
now can we stop
thank u brad

2nd? which one is the first?
probably #python-discussion
brad whats the third?
lol usually people came here because no one help them in general xD

uhh then what exactly does questions mean?
whats the less popular
Lets not get pedantic
how do you have this knowledge
Message counts
@lusty spear collects channel metrics
ohh

i thought it would be ot-1 because no slowmode
Suggest more topics here!
Im just trying to clarify rules??
A feature that gives you a random language that you have to guess
like a guessing game for languages
context managers or dropdowns im kinda lazy to learn them
theres examples on the repo for dpy
Uh there's a really cool thing for something like this online lemme see if I can find it
ik i just got to learn its methods ill just read src when i can
is it like the same as in #python-discussion? u can ask small questions but for anything bigger use dedicated channels
ok
no u can ask for help here
https://github.com/Rapptz/discord.py/tree/master/examples/views are for modals and the other stuff
Yes, especially if you are looking for prolonged dedicated help to solve a problem
yeah i got to learn modals but i use disnake 
how to do attachment.save as file named by u?
i mean to to name the file
that save with attachment.save?
alright thanks
This being a topical channel is not a replacement for a help channel
ohh
Ah damn the site is down, but it was made by Ben Awad here: https://www.youtube.com/watch?v=pXDM5CA47Mg
disnake probably has it aswell
yeah they do
ill claim a channel then since nobody can help here
k lol
?
you dont need to announce that
how to do attachment.save as file named by u?
i mean to to name the file
that save with attachment.save
what's the library for bot commands?
how am i arguing?
from discord.ext import commands
thanks
np
i feel like you're just picking a fight for no reason
i just came and asked my question
^

what question?
it was something that happened its not of the matter anymore
Stop.
can u ans my question?
sure what is it
how to do attachment.save as file named by u?
i mean to to name the file
that save with attachment.save
how about we stop that instead of pointing fingers at each other
!ot
Off-topic channel: #ot2-never-nester’s-nightmare
Please read our off-topic etiquette before participating in conversations.
can we get on topic already
files = []
for attachment in ctx.message.attachments:
await attachment.save(attachment.filename)
``` this might be scuffed im not really used to this
where do i name it?
you need to open a file and save to that file, for example
with open("myfile.png", "wb") as f:
await attachment.save(f)
attachment.filename
you can make an arg for the name if you'd like
oh
await attachment.save("my_file")
i did that but guess i didnt use paparantheisis
!mute @slate swan 2h You've been asked to stop, and you've chosen to continue. Please take a take a timeout. In the future, listen to the guidance of the moderation team.
:incoming_envelope: :ok_hand: applied mute to @slate swan until <t:1648569151:f> (1 hour and 59 minutes).
yeah this is better
hes talking about in a message
oh yeah theres your problem. good luck with your bot 👍
"please take a timeout" the please killed me lol
sit on the bottom of the steps and think about your actions
I'm too desensitised to even care about mod actions anymore lol
and how can i upolad the file in an embed?
embed.set_image(url="path2imagehere")
oh
embed.set_image(url="homework/lolis/loli1394.png")
only if its an image, u cant upload any file in an embed
thanks helped me making my deleted message logger
lol
supported formats should be png, jpg and few others i think
note: dont use webp because apple devices dont work with it.
you can use bytes.io and use its byte64 as the image

or like. an imgur api
or something idk
since the direct url disappears after 5 or 4 minutes i first saved it and then uploaded it .
will it work now? even after i delete the image from my device?
virus.exe.c.exe.py.js.rust.rb.rs.bf.png.webp.mp3.mp4.java.html.css.md.pyc.c++.png
yeah but you wont be able to send it after deletion
fyi I'd be really really hesistent to reupload arbitrary media, if someone uploads CSAM and you reupload it you are in a whole load of trouble as a result
uhm i think that c++ extension is cpp
.bashrc
oh ive never used cpp so i dont know
i just need to send it once
i've developed with arduino so lol
than ks for the help
ohh
okay wait so I want to make a slash command that uses a modal.
The command is note edit [note]
when I use the command, a modal comes but the text inputs are already filled with the name and content of the note
can anyone guide me please
I know that i use the value but the part of the db operation based on the input of the user confuses me
@Client.command()
async def button(ctx):
await ctx.send(
"",
components = [
Button(style=ButtonStyle.red, label = 'test!')
]
)
interaction = await Client.wait_for("button_click", check=lambda i: i.component.label.startswith(""))
await interaction.response.send.message(content="test")
#await interaction.respond(content="test")```
Why does this not work?
you shouldnt name your bot that
im sure its the Client class
they didnt even make bot
the Client class doesnt even have commands bro
Lol what they mean is that you probably are calling the Client class
so it doesnt work :^)
if you want to name your bot "client" you should name it lowercase
that would raise an attr error no?
so it does?
why did u assume it doesnt
I made it in "Client"
yeah it raises an error, why r u asking that
so what to change??
everything, consider subclassing D_D
shouldnt even name instances like that only in the class lmao
Client is low-level (not friendly for you). use discord.ext.commands.Bot not discord.Client
subclassing?
hes using a 3rd party lib i think
discord-components. ive seen it befroe
its rlly outdated
but can you send a simple button command then?
no
okay
we cant spoonfeed you
dont you need views for buttons
class myBot(discord.ext.commands.Bot):
def __init__():
super().__init__(command_prefix=wathever)
#your stuff
for the naming thing I'd take a look at https://t.vco.sh/tips/clientbot it'll help explain why the naming is wrong too
tfw bot is client
what about Client.Autoshardedbot
its not needed unless 100+ servers
if you're at the point of needing sharding you probably know how to name variables
no it says thta client cant shard
Authoshardedbot is suggested for bot which are in more than 100 servers
Isn’t it 2000?
You shouldn't really even be starting to shard until about 1.5k guilds
you must shard at 2.5k
maybe they're a marketing expert not a programmer
are shards like 1k servers
anyone?
depends how many servers and shards you have
nvm just forget it
but you should aim for between 1k to 2k guilds per shard
what lib
i have like 40 - 50 per shard
with 5 shards atm
disnake
That's just a waste of identify calls
no way
lol it's not that client is wrong, technically they are both wrong because the best way is to subclass your bot, so you have your own instance of the bot and you can automate a lot of things in a better way, btw if you want to create your bot instance with a variable is suggested to use lower-case name and to make sure that the name is not used by any of your package
it doesnt have any slowdown, and i wont have to do it later
does discord py support the new timeout ft?
In 2.0
I mean, you do you, it's just kinda pointless to shard with such low numbers and increases load on Discord's servers for no good reason
yes
In 2.0
so not stable yet
how is 2.0 used/installed
pip install disnake[discord]
why no
not disnake use the actual dpy library 2.0
because stable for months
pip install git+https://github.com/Rapptz/discord.py
^
@maiden fable here's a question for you
disnake is actually better than most of the forks and d.py
that's it?
same as pycord, and same as nextcord
That’s how you install
import ?
they're all the "best"
Not the same
Disnake is better than nextcord for sure rn
totally not
disnake the best
nextcord sucks
It would be same
How so?
ok thx
disnake is made by the original creator of dislash and hes a good dev
lol nextcord has slash commands from like less then 6 months, dunno of pycord but a lot of people didn't like it
the owner is trying to get danny to quit via toxicity. and also trying to make it seem like nextcord isnt a fork and is its own thing removing the original credits from danny
That’s pycord
hes mad that danny came back to dpy
that was not pycord? at least i dont think?
well I'm certainly not trying to get danny to quit via toxicity lol
Well pycord claimed they made the whole thing
i switched away from pycord because they use outdated libs and development was swifter on disnake
pycord as in. bobdotcom? or someone else?
kek
The readme and description of nextcord literally says "A maintained fork for Danny's discord.py"
that is very old
No?
Never used modals, sorry
pycord is becoming very outdated and very inactive with issues (i have no idea they only respond quickly to feature requests then never fix any issues with said requests)
consensus: use disnake
issues being open for 9 days is far from inactive
or hikari
thats the firstpage
they go all the way to sept 2nd
so what about the DPy pull requests that have been open since march 2019
thats 3 years old
I mean...i just have to use the vale related to modsl rest is classes ig
they're getting fixed in the april 30th push
every large OSS project has old issues and PRs
some things are just higher priority
thats just how it is
not being able to use commands on a mobile device is not high enough priority?
that doesnt even sound like a pycord issue
alot of bots now are 100% slash commands
its just that pycord's devs are not the best compared to the alternatives
also its been open for 12 hours
well its there
and also jank asf
has anyone tested slate 2?
Idk maybe they changed it but it was like that at one point
so if I open an issue called "Pycord made my house burn down" and they leave it open for half a day because they have no idea what to say does that make pycord bad
me
I agree that some things about pycord aren't very good and could be far better, but leaving PRs and issues open for a while is just a part of open source life, not something worth complaining about unless they're really severe
No it wasn't
how is it
tbf their website definitely used to not mention anything about discord.py at all
That one error on the dpy most of us know make me use pycord
Waiting for voice receive in disnake 
unsure if this has been changed yet
waiting for voice send
oh hunter so you're alive
Ah yea sorry. Was busy with pyweek in the former week
how was pyweek
?
Ah. Well yea, there were many game breaking bugs in the last 2 days (all by yours, Hunter) so that took up to 1 day to fix. Other than that, it was fun!
hunter could you help with the question above please lol
nicee
Sorry Raven, as I said. I didn't even look into how they are implemented or how to use them. Would have loved to help if I knew how to use them
no but
look
class Modal(disnake.ui.Modal):
async def __init__(self, bot) -> None:
self.bot = bot
components = [
disnake.ui.TextInput(
label="Note name",
placeholder="Enter note name here",
custom_id="name",
style=disnake.TextInputStyle.short,
max_length=100,
value = #PRE-TEXT VALUE HERE
),
yello
Mhm
for the value, i want it to be the value of a database operation based on the name inputted by a command.
example: using !test note where the note is the name of the note will make a db operation selecting the note and content of the note and put is as value
it doesn't have much to do with knowing modals
Then just fetch the text from db and do value=record[0] where record is the tuple u got from the db?
I'm not trying to get Danny to quit by toxicity (not quite sure where you got this from)
We are working on becoming our own thing in v3! Credit to Danny was removed as all code from discord.py was thrown away. This means we are no longer a fork as well none of the code would be the same. We do credit Danny in version 2 which is a fork.
Hope that clears things up.
thinking about it now, I should be putting data in the init right?
data?
like just a var for the user input
Yea, ig try it out
oh wow i was over-thinking it way too much
Haha understandable
also, does anyone know if/how to make the new python 310 union syntax compatible with converters?
!d discord.Member.joined_at
An aware datetime object that specifies the date and time in UTC that the member joined the guild. If the member left and rejoined the guild, this will be the latest date. In certain cases, this can be None.
okay so now can someone help me with timing out a user on dpy 2.0
and created_at
created_at refers to creation date of the object
Can you do datetime_obj > datetime_obj2 to check if date occurs later than another?
because im making a timer command for my bot
uhm probably, you should check datetime docs, date object are datetime objects
yeah
nice
at least i think its what i do when im doing web dev
var x = document.getElementById("time");
var d = new Date();
var hr = d.getHours();
console.log(hr);
if (hr < 10) {
x.innerHTML = "Good Morning!"
} else if (hr > 16) {
x.innerHTML = "Good Evening!"
} else if (hr > 9) {
x.innerHTML = "Good Afternoon!"
}
lol this is javascript .-.
..yeah.
we don't use ||shit|| languages here
i just use it for web dev
never heard of jinja?
npoe
is a template engine which is used to write code similar to python syntax in html
you can use it so pass variables from html to python and vice versa
it generates html?
meanwhile me writing go 
me with ruby
do you mean create entirely html code?
me with coffeescript
how can i make it so bot can only respond to specific users when using an on_message command?
well you can write html with python even without jinja lol
nah you said like a template so i thought it generates html
if message.author.id = idhereuwant
trying to send logs to a specific channel got it working once but now its not working :/ obvs this sends to same channel await ctx.send(embed=logembed) but I tried this for the channel I want await ctx.send(logschannel)(embed=logembed)
with specific role?
if 'rolename' in message.author.roles
!d discord.ext.commands.Bot.get_channel
get_channel(id, /)```
Returns a channel or thread with the given ID.
Changed in version 2.0: `id` parameter is now positional-only.
logschannel = bot.get_channel(948625408306343957)
thats what I did with this correct?
yup
and you send it there
then to send you use logschannel.send("WOOOOOOOOOOOOOOOOO")
or you can just do it in the same line
amm
bot.get_channel().send("")
a coroutine
right
await ligma.balls("now")
you need perms

giv bot admen
more like the permissions needed
from discord_slash.utils.manage_commands import create_choice,create_option
bot = commands.Bot(command_prefix='.')
slash = SlashCommand(bot, sync_commands=True)
@slash.slash(
name="hello",
description="Just sends a message",
guild_ids=[847167065788907520],
options=[
create_option(
name="option",
description="Choose your word!",
required=True,
option_type=6,
choices=[
create_option(
name="user",
description="Select a user",
required=True,
option_type=6,
)
]
)
]
)
async def getuser(ctx:SlashContext, user:str):
await ctx.send(user.id)
then I get this Command raised an exception: AttributeError: 'NoneType' object has no attribute 'send'
this
channel id is wrong
or tha
how I fix that then lol
if youre using disnake just use getch
fetch the channel with the api
!d discord.ext.commands.Bot.fetch_channel
await fetch_channel(channel_id, /)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).
Retrieves a [`abc.GuildChannel`](https://discordpy.readthedocs.io/en/master/api.html#discord.abc.GuildChannel "discord.abc.GuildChannel"), [`abc.PrivateChannel`](https://discordpy.readthedocs.io/en/master/api.html#discord.abc.PrivateChannel "discord.abc.PrivateChannel"), or [`Thread`](https://discordpy.readthedocs.io/en/master/api.html#discord.Thread "discord.Thread") with the specified ID.
Note
This method is an API call. For general usage, consider [`get_channel()`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.Bot.get_channel "discord.ext.commands.Bot.get_channel") instead.
New in version 1.2.
Changed in version 2.0: `channel_id` parameter is now positional-only.
from discord_slash import SlashCommand, SlashContext
from discord_slash.utils.manage_commands import create_choice,create_option
bot = commands.Bot(command_prefix='.')
slash = SlashCommand(bot, sync_commands=True)
@slash.slash(
name="hello",
description="Just sends a message",
guild_ids=[847167065788907520],
options=[
create_option(
name="option",
description="Choose your word!",
required=True,
option_type=6,
choices=[
create_option(
name="user",
description="Select a user",
required=True,
option_type=6,
)
]
)
]
)
async def getuser(ctx:SlashContext, user:str):
await ctx.send(user.id)
what i do
dont use that lib
use main
where
what?
from discord_slash.utils.manage_commands import create_choice,create_option
bot = commands.Bot(command_prefix='.')
slash = SlashCommand(bot, sync_commands=True)
@slash.slash(
name="hello",
description="Just sends a message",
guild_ids=[847167065788907520],
options=[
create_option(
name="option",
description="Choose your word!",
required=True,
option_type=6,
choices=[
create_option(
name="user",
description="Select a user",
required=True,
option_type=6,
)
]
)
]
)
async def getuser(ctx:SlashContext, user:str):
await ctx.send(user.id)
this is the code
yeah
future: <Task finished name='Task-1' coro=<SlashCommand.sync_all_commands() done, defined at C:\Users\groma\AppData\Local\Programs\Python\Python310\lib\site-packages\discord_slash\client.py:416> exception=Forbidden('403 Forbidden (error code: 50001): Missing Access')>
Traceback (most recent call last):
File "C:\Users\groma\AppData\Local\Programs\Python\Python310\lib\site-packages\discord_slash\client.py", line 440, in sync_all_commands
existing_cmds = await self.req.get_all_commands(guild_id=scope)
File "C:\Users\groma\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\http.py", line 248, in request
raise Forbidden(r, data)
discord.errors.Forbidden: 403 Forbidden (error code: 50001): Missing Access
error
^
youre missing perms
"fetch_channel" is not defined
does your bot have the application.commands scope?
it's a method tied to the discord.Client class
its a method bound to a bot class instance
not a global function
a function is enough
why is it enough
it doesn't hurt to share a bit more information about something does it 
a function is enough no need to say a global funcion
when you invited your bot did you have application commands scope and what action are you trying to do?
ok i am making splash command and i give perm application commandsin gernal auth and server also but not working
i have a question, how do i ban a list of users
every guilds have it
!d discord.Guild.bans
await bans()```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).
Retrieves all the users that are banned from the guild as a [`list`](https://docs.python.org/3/library/stdtypes.html#list "(in Python v3.10)") of [`BanEntry`](https://discordpy.readthedocs.io/en/master/api.html#discord.BanEntry "discord.BanEntry").
You must have the [`ban_members`](https://discordpy.readthedocs.io/en/master/api.html#discord.Permissions.ban_members "discord.Permissions.ban_members") permission to get this information.
what
oh whait i wrote something for another lol
oh i see
well it's a little bit complicated, do you want to ban them permanent or for a specific time?
permanently, if possible
well this make things easier
so would this be right?
no need
im using ```py
await ctx.guild.ban(discord.Object(id=int(members)))
you can just make an argument that expects a tuple of members and make a for loop lmao
so in your command you have to take as parameter everything that the user will write, probably you will need a separator because after that you need to convert that string into a list
then you have to check if every string in that list is a member object, using a converter or a get method, your choice
after that you can iterate through that list an ban those member
^
if you want to do it for all guild members thats just sus
ill try both of these thank you
its just *members: discord.Member
they are the same thing essentially xD
i want to ban potential raiders lol
TypeError: ChoiceData.__init__() got an unexpected keyword argument 'description'
now this error is comin
when i remove description
it give one agument missing
what i do
@slash.slash(
name="hello",
description="Just sends a message",
guild_ids=[802551733443493888],
options=[
create_option(
name="option",
description="Choose your word!",
required=True,
option_type=6,
choices=[
create_option(
name="user",
description="Select a user",
required=True,
option_type=6,
)
]
)
]
)
async def getuser(ctx:SlashContext):
await ctx.send("hello")
code
is this
it does hurt my feelings, jk😡
Why doesn't the bot take the full name of the server?
erorr: OperationalError: near "Greatest": syntax error
Help me please)
its a basic syntax error
help
no such kwarg the dunder takes/has
sorry

sql?
OMG
?
SQL IS JUST SO GOOD
i agree
we know x
sql is goated
its beautiful isnt it
ikrrr
you have mastered the art of SQL 
SQL is so easy to remember 
im just amazed
i love making commands with dbs no cap
that what makes it LOVELY
like so easy
Yes
ask in #databases, send the full error there
so what should i do?
you dont pass the kwarg???
need help with 2nd line :
if user_message.lower() == '.customer1':
if (your role isnt the role 958363828037517376 ):
await message.channel.send('You can't use this command')
else:
await message.channel.send(password)
return
anyone?
it's there
are you updating it?
!d del
7.5. The del statement
del_stmt ::= "del" target_list
``` Deletion is recursively defined very similar to the way assignment is defined. Rather than spelling it out in full details, here are some hints.
Deletion of a target list recursively deletes each target, from left to right.
Deletion of a name removes the binding of that name from the local or global namespace, depending on whether the name occurs in a [`global`](https://docs.python.org/3/reference/simple_stmts.html#global) statement in the same code block. If the name is unbound, a [`NameError`](https://docs.python.org/3/library/exceptions.html#NameError "NameError") exception will be raised.
what are these questions
you want to see if user has that role?
yh
get the role with the id and guild
role = guild.get_role(id)
check if role in member.roles
so i created a task py @tasks.loop(seconds=10) async def foo(self): pass foo.start() this is in a cog, how do i pass in self?
because i need it
where?
in the foo tasks
?
if it is in a cog self is automatically passed .-.
Traceback (most recent call last):
File "C:\Users\shake\AppData\Local\Programs\Python\Python310\lib\site-packages\disnake\ext\tasks\__init__.py", line 157, in _loop
await self.coro(*args, **kwargs)
TypeError: fetch_data_cog.check_reminders() missing 1 required positional argument: 'self'```
role = guild.get_role(id)
if role in member.roles:
#do something
it's not in the cog
it is tho
show
class fetch_data_cog(commands.Cog):
def __init__(self, bot):
self.bot = bot
self.reminders = dict()
@tasks.loop(seconds=10)
async def check_reminders(self):
current_time = datetime.now()
await self.bot.wait_until_ready()
for key in self.reminders.keys():
if self.reminders[key] > current_time:
try:
member = self.bot.get_user(key)
except BaseException:
print(f'Couldn\'t find member {key} for reminder checking.')
del self.reminders[key]
continue
else:
if self.reminders[key] > current_time:
await member.send(f'{member.mention} your reminder is up! ({discord.utils.format_dt(self.reminders[key])})')
check_reminders.start()```
start in the __init__
k
with self.check_reminders.start()
do i need to import a library?
hi guys is there a way for the bot to know when a user is online and offline ? thanks
no
NameError: name 'guild' is not defined
get the guild
!d discord.User.status
is this a command
yeah
ctx.guild.get_role
!d discord.Member.status
NameError: name 'ctx' is not defined
status lowercase
!d discord.Member.status
property status```
The member’s overall status. If the value is unknown, then it will be a [`str`](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.10)") instead.
you said it's a command
it is
thanks
yeah
if role in message.author.roles
what happened
How can I get the full source code of a Multipurpose Bot
like.. searching on github?...
you what
what
u cant just get codes of all the multipurpose bots but u can get some
Search up "multipurpose discord bot python GitHub" but don't you dare copy paste
#bot-commands
I will not copy paste as it is piracy
I will take only for help
!src
Lmfao
is the best you'll probably get
it's modular, complies with style guides, but it's still simple
Also btw multipurpose bots don't hold up
idk what you mean by that
I mean they're practically useless
i need to set the cooldowns for the whole server
is it @commands.cooldown(1,30,commands.BucketType.guild)
?
the BucketType is per guild in your situation
is it like this
!d discord.ext.commands.BucketType.guild
The guild bucket operates on a per-guild basis.
i wish discord would let you send an ephemeral message without an interaction
i.e to warn of a cooldown without bothering people
since they're pushing for slash commands everywhere
we'll never see
can anybody help me I made my database using mysql, now I need to make an antilink on off the problem is that I don't know how to use my database
ephemeral message to the author who invoked the context? yeah that would be cool
yes
my bots ping so good it told me i enter an invalid command before actually sending it
im fucking scared now lol
perhaps
doubt it
sometimes happen, just a visual bug
ye
when you send a message it makes a gateway event which then bot parses the event which would take time so its probably just a bug or youre just trolling
It may be a network issue on the person's client side
yeah
nah he just has different time zones from his VPS
and didn't use utctime()
its not about the time lol
its that the command error got sent before the message
Are you trolling or just trying to tell facts?
which is probably an error with his client or sm
By client I mean discord app
same
how to fix that the image links dont load? I used Imgur Links
no no regardless
he just send the command twice and cut the first part
or deleted the message lol
yeah hes probably trolling
im not
probably?
i added a snipe command, not trolling
are you sure it isnt your network?
yes, other people see it as I do
is the picture invalid?
What do you mean by that?
yes it is
he's giving it the link to a page with the image embedded
some images would be invalid and wont show
not the actual image url
which should display.
with imgur i've never seen it display unless it's the actual raw link

wow
