#discord-bots
1 messages · Page 1103 of 1
Guys please I'm so close to solve my problem totally !
async def select_anonymous(message, client, data):
view = AnonymousView()
msg = await message.channel.send('Do you want this report to be **Anonymous**?', view = view)
tasks = [asyncio.create_task(view.wait()),
asyncio.create_task(client.wait_for('message', check=button_check))]
done_tasks, pending = await asyncio.wait(tasks, return_when=asyncio.FIRST_COMPLETED)
if tasks[1] in done_tasks:
return 'Cancel'
else:
return 'Done'
the function view.wait() returns 1 or 2, and I need that to be retured in the very last line of my code instead of 'Done' ! Please help me 
!e py import time y = time.time() print(f"{int(y)}")
@lyric apex :white_check_mark: Your eval job has completed with return code 0.
1655352376
If you want to use Discord's timestamp formatting, what you're asking for isn't supported.
You can read here for more info: https://discord.com/developers/docs/reference#message-formatting
Integrate your service with Discord — whether it's a bot or a game or whatever your wildest imagination can come up with.
thanks
Use this int that will get you want*
do i use <t:1624855717> in python to do <t:1624855717>
when i tried it in mine it didnt work
<t:1624855717>
There exists different styles
what would i do in python to make it say date time
I saw a bot just do it
Can you show
Use <t:epoch time:t>
okk
Oh I thought you wanted the seconds included in your message
It doesnt show years
I want it to show month day year time
@sonic flax
i mightve got it
ok last question, how do i make the title invisible in an embed
title isnt a required kwarg
You can remove it simply
!d discord.Embed
class discord.Embed(*, colour=None, color=None, title=None, type='rich', url=None, description=None, timestamp=None)```
Represents a Discord embed.
len(x) Returns the total size of the embed. Useful for checking if it’s within the 6000 character limit.
bool(b) Returns whether the embed has any data set.
New in version 2.0.
For ease of use, all parameters that expect a [`str`](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.10)") are implicitly casted to [`str`](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.10)") for you.
Changed in version 2.0: `Embed.Empty` has been removed in favour of `None`.
Oops i meant name
in fields
So theres no . at the top
It is required but yeah there exists many way you can use _ _ to make it invisible
But there will be a space
Please don't send empty messages
you cant send empty messages
it will be even if you are using invisible characters
since an entity exists at that place 😔
Is that?
is it entity 303 😳
Can you tell him *
_ _
How did he do this then
_ _
those are crossed spaces not empty messages
its at the bottom tho
Ah
And not a footer
Ashley is here
there always will be a space, you cant change it by any means unless it's a zero width character (which doesn't change anything too)
^Gud Nyt^
How did he do this then
Lol
night, have a good sleep
my fav lizard-
can i see the whole embed?
that's probably just the description but with a bullet character
I said that earlier
Bruhh
The embebd value is just bullet character
it's a field with multiple lines
wdym
O god now i get to know that what a half ss can do
OH'
Embed.add_field(name="involved", value="user1\nuser3")
embed.add_field(name="Field", value="• Section 1\n• Section 2")
thanks
new line exists
("•_•)
):
the eyes are bullet character
- _ *
____ ____ ____
("•o•) \🔫 (•_• ) \🔫 (•_• )
|_ | |_ | |_ |
in Discord markdown
\_\_\_\_ \_\_\_\_ \_\_\_\_
("•o•) \🔫 (•\_• ) \🔫 (•\_• )
|\_ | |\_ | |\_ |
-_- | _ | ~_~ | _ | °_°
-_- | _ | ~_~ | _ | °_°
#OwO
#UwU```
Helpers:
Let me out of this codeblock!!! .catch(console.error) ========--------------------💨 Someone:
____ ____ if __name__ == "__main__": ========----💨💨 can u fix??
(•o•") (•o•") const [list, setList] = useState(0); ========-----💨💨 (•_•')
🔨 | | 🔨 | | def main() -> None =====------💨 | |
||Alr Gn||
gngn
I made a kick cmmd that only admin have the permission and if any member use this command i want to show the reply from bot "that you dont have permission to use this cmmd" how can i do that
Use the @kick.error decorator
It takes ctx and error
You can check if error is of type MissingPermissions via isinstance
and you cant send messages to a memver after theyre
kicked
unless they have any other mutual server with you
Thanks
And there is one more problem😅 the meme is coming after 10sec when executing the meme cmmd
show code
your internet is probably slow to fetch memes
that wouldnt matter
Im not using computer iam useing replit in my phone😅
only real thing that can slow down from making a request is your wifi, and if its delayed maybe something is blocking your code
Never knew we were developing MEE6 👀
show the code else we can't help efficiently
mee6 is everywhere
The reason I mentioned it and not Dyno is cz it's coded in Python
you would need to use asyncpraw
mee6 is in py?
yes
why r u using reddit package lol, that's synchronous and blocking
did the devs say?
Private wrapper, yes
mee6 is written in python with a private api wrapper
Heard it in their official server
You can just use aiohttp to fetch it
weird because when i asked, they said that they don't want to disclose it or whatever
https://reddit.com/r/memes/random/.json
Not working used aiohttp, urllib and searched on youtube they used impory nextcord but in replit its not working atlast i find this....
bro 😔
old youtube tutorials are no good
you know you can replace nextcord with discord right 😔
unless they use any library-specific features
It's dpy, they too shy to admit it xD /j
doubt it
they have too good developers to use such a lib
Im done im going to delete this bot🙁
why
Lol
if i would make a bot as big as mee6 i would make my own api wrapper tbh
what if the private api wrapper was just a discord.py fork
Nice, you are one step closer to being a bot dev
🍴
they wouldnt use dpys old code base
maybe a fork of a discord.py fork
You first make a bot, then it becomes popular....
Cant do anymore actually i dont know python i made this bot by searching on google and copied many codes🙁
i ment it as if i had a bot with such popularity
almost every dev does that lol
not really
🙁
i used to copy a lot of stuff from stackoverflow
a dev only searches for answers not full on snippets you dont learn by getting spoonfeed, you actually have to take time to understand and learn the language
U r better off writting it urself
i did
a long but grateful process
i mean some snippets if already written u need not write it again
i looked at a code and see what it does bc there's usually some explanation on top of the code you copy
Mee too i made this bot by the codes in stackflow 🥲
not thats basically a mash up of God knows what
i meant like small pseudo code or formulas some opencv processes that kind of stuff
if you copy code and don't change variables, etc, and expect it to work, now that's what you call a skid
That's not really how you learn, even if you know copied code in detail, you didn't participate in the process of making it. And that aspect is what is beneficial in future
how will i learn if i don't know anything
I wanted pc but cant afford that so i used replit to code😂
i type the code on vscode, not copy & paste literally
that's... i guess you could say "that's not how you learn, you didn't make the tutorial"
That was not aimed at tutorials
how do i change a members permissions in a channel
async def my_function(message, client, data):
await message.channel.send('Give me 3 images of cats !')
def check(m):
return m.author == message.author
msg = await client.wait_for('message', check=check)
return str((',').join(msg.content.split(' ')))
This function asks for 3 images of cats and returns a string of the links seperated by commas.
Although, if you write anything it will just store it. I'd like it to rerun with a message when someone sends anything that isn't a link. How would you do such a loop?
why not create roles with those perms and assign
check if https in the input string
what would you consider learning then
This part is fine ngl, I'm looking for a way to loop until the sender sends a link or cancels
use a while True:
no need for a loop
while 'https://' not in message.content
not a while please
sender sends a link
then Bot.wait_for would wait for an event to be dispatched
oh or i just edit the check function u mean?
yeah u can do that too
yes use the check kwarg
what do you mean?
oh !!!
okay !
it's basically an event and when u use it in a command it works until the check is satisfied and it moves on to the next part of the code
I got it !
there could be attachments
message.attachments[0].url then
that's another thing I'll be thinking about
if they're attachment I'll find a way to capture them, upload them somewhere, and then store the link

that's tough tho I hope I'll find an API of a image host to do it
if message.attachments returns list of attachment objects.
what if there are no attachments, it will raise an IndexError
should I write it out for him?
no
then what do u want me to do?
dunno
-_-
give command ideas
for u?
how do i change a members permissions in a channel after creating it
mhm
have you tried pls help in dank memer?
wait
if u havent there is endless amounts of inspiration there for u 300+ commands ig
https://deta.sh (go to the drive section)
don't wanna make economy commands 
- dank memer is meh
^
every bot is shhhh rn
[<discord.ext.commands.core.Group object at 0x7f456442bbb0>]
no not economy commands i am talking about their slice of life commands there is some crazy stuff there especially in few sections 💀
thats a repr of a group command, you can do commands.parent.name for the name
pfft
isn't that commands.grandparent?
what does this mean
commands.great_grandparent when?
like i want to get the group of commands like if i have a command lol and their groups as lol say, lol fk i want to show them
try reading the linked docs, I can't really explain rn sorry
await channel.set_permissions(member, overwrite=None)
instead of member do i put their id?
let's traceback to ancestors
ik it's a jk
await channel.set_permissions(member, overwrite=None)
instead of member do i put their id?
!d discord.ext.commands.Group.commands
property commands```
A unique set of commands without aliases that are registered.
ohhhh thank youuuuu !
Imagine still being able to joke
i am on it
imagine not being able to
and as a side not, as you wanted to store three images per member, you can do something like {author_id}1.jpg, then {author_id}2.jpg etc. in order to save 3 images
u could just do user:[*imgs]
the file ext can be anything
preferably pngs and jpgs
it's a Drive....database
oh ic
it's a good one since you can get 10gb storage for free and upload files for 10gb heh
well if it's just links prolly a dict would be easier since he is not downloading and storing images
i them as objects how i convert them?
downloading and storing it in a cloud db, better
{<discord.ext.commands.core.Command object at 0x7efc97788220>, <discord.ext.commands.core.Command object at 0x7efc97788070>, <discord.ext.commands.core.Command object at 0x7efc977882b0>, <discord.ext.commands.core.Command object at 0x7efc97788340>, <discord.ext.commands.core.Command object at 0x7efc97788190>, <discord.ext.commands.core.Command object at 0x7efc977883d0>}```
oh that's a nice idea !
overwrite = discord.PermissionOverwrite()
overwrite.send_messages = False
overwrite.read_messages = True
await channel.set_permissions(member, overwrite=overwrite)
what do i put for overwrite
depends on what u are using it for
probably
but storing images that way could be better
since if you wanna use a link, it can lead to problems
def check(m):
return (m.author == message.author) and (('https://' in message.content) or (message.attachments and [x.content_type.startswith("video") for x in message.attachements]))
I want my function to check if the author of the message is the author of the request, and if there are image links in the message, and if there's attachements sent otherwhise (and check if they're images)
Is that fine?
yeah like i upload an attachment store the link and delete the attachment the image is no longer available
and using discord for creating links to the image is surely not a good idea
yup
@slate swanhow to convert object in strings?
i've had problems that's why I'm trying to find a website that uploads images with an API system
str()
is this correct guys? :D
aka the built in string converter
it didnt worked
if you want to see the results just check the str dunder in the source code of the class youre looking for
yeah but i didn't find a better solution for rapid links other than that🤷♂️
para = [str(command) for command in y.commands]```
@slate swanis that ok?
you're just abusing discord :)
i would use map
do you want the command name or what?
name
well poor discord
then just use the attr
says the one who abuses it like hell
no not that bad yet 
def check(m):
return (m.author == message.author) and (('https://' in message.content) or (message.attachments and [x.content_type.startswith("image") for x in message.attachements]))
Is this fine to you guys?
Bro big fan
yet, even though it shouldnt get verified
I pity discord bots for such developers
can i get its signature in this
or i have to define it again
whose?
the check function should always return bool because the object that will be returns from Bot.wait_for will only return if your check returns true so no, thats not fine. if youre waiting for a message it will return a Message object if you didnt knew.
command.signature then
I am sure discord would actually love it since they are just getting more data to sell
yeah I know that ! I'm just trying to check if everything is fine...
how can I check to see if a channel exists by name?
would be great if I could also check what category it's in
well you would check it and then return True if you want that condition
its better and not esoteric
Then I'll just do this:
def check(m):
return (m.author == message.author) and (('https://' in message.content) or (message.attachments))
And then when there's https:// or attachements, i'll code functions to check if they're images or not
Your
you can just do
if condition:
return True
because that's already a nice filter
over returning the results which will probably be truthy
:o
OHHHHH !
You're a genius omg XD
@maiden fable random question have you used asyncpraw before?
i have
overwrite = discord.PermissionOverwrite()
overwrite.view_channel = True
await channel.set_permissions(int(person1), overwrite=overwrite)
await channel.set_permissions(int(person2), overwrite=overwrite)
i would prefer to use aiohttp tho
InvalidArgument: target parameter must be either Member or Role
the reddit module?
sell?
How do u think Discord earns money
do you know somewhat a lot about it? and can i ask some thing in a help channel?
asyncpraw should only really be used for objects and lib abstractions
discord.utils.get .....?
i havent used it in about a year but i do know allot about it
never thought about it
and then what for the channels?
channels?
Just like every other big companies, they sell user data 🤷♀️
not id, has to be by name
can someone help
overwrite = discord.PermissionOverwrite()
overwrite.view_channel = True
await channel.set_permissions(int(person1), overwrite=overwrite)
await channel.set_permissions(int(person2), overwrite=overwrite)
Why do i get InvalidArgument: target parameter must be either Member or Role?
discord.utils.get(guild_channels_iterable, name="uwu") ....?
this could be inaccurate sometimes though
but works most of the times
disnake doesn't have guild_channels_iterable
didn't they say bring out ur wildest imagination on their dev page?:p
unless it's got some sort of additional context
Wildest Dreams
yeah whatever
:p
ctx.guild.channels
smh
the questions crack me up sometimes
this is on_message_edit which just has self, before, after
I uhh....okay
after.guild.channels then
there is no ctx in this context lol
before.guild.channels
or after.guild.channels
these channels will include categories too, right?
that sucks
Thanks Danny
How did you guys learn python😅
yea, guild.text_channels and guild.voice_channels
By lurking in this channel
so you can just ```py
channels = Guild.text_channeld; channels.extend(Guild.voice_channels)
Lurking meaning😅
overwrite = discord.PermissionOverwrite()
overwrite.view_channel = True
await channel.set_permissions(int(person1), overwrite=overwrite)
await channel.set_permissions(int(person2), overwrite=overwrite)
Why do i get InvalidArgument: target parameter must be either Member or Role?
helppp
channels = guild.text_channels + guild.voice_channels
the int(person1) should be a Member instance
yeah f
I wonder why, discord.Object should work too
Ig, never tried
all they use is the Id anyways
Yea
what is a member instance
!d discord.Member ctx.author and message.author can return one
class discord.Member```
Represents a Discord member to a [`Guild`](https://discordpy.readthedocs.io/en/latest/api.html#discord.Guild "discord.Guild").
This implements a lot of the functionality of [`User`](https://discordpy.readthedocs.io/en/latest/api.html#discord.User "discord.User").
x == y Checks if two members are equal. Note that this works with [`User`](https://discordpy.readthedocs.io/en/latest/api.html#discord.User "discord.User") instances too.
x != y Checks if two members are not equal. Note that this works with [`User`](https://discordpy.readthedocs.io/en/latest/api.html#discord.User "discord.User") instances too.
hash(x) Returns the member’s hash.
str(x) Returns the member’s name with the discriminator.
well it should right, since its just a data class with an id variable which will be an int
hm
i want it to be the 2 user's ids i put in the command tho
im not sure if that was sarcasm or if you were serious
x == y Checks if two members are equal. Note that this works with User instances too.
x != y Checks if two members are not equal. Note that this works with User instances too.
what does it mean by equal btw
how do i turn their discord id into a member instance
just do discord.Object(id_here)
no need for his case
do i put that in place of of the int(person1)
Yes
im pretty sure it would be the same thing
im aware how the api works, was talking about discord.py, and no dpy won't allow you to do that
if discordID in [301480016657776642, 464721355116380160]:
a = 0
b = 10
elif discordID in [92786442891169792, 746850928417701990]:
a = 85
b = 99
else:
a = 49
b = 99
Spiking = np.random.randint(a, b)```
i currently have this part of a command which works by itself when taken out and works for the first if and else, but for elif it doesn't do anything? no errors either
discord/abc.py lines 914 to 919
if isinstance(target, User):
perm_type = _Overwrites.MEMBER
elif isinstance(target, Role):
perm_type = _Overwrites.ROLE
else:
raise ValueError('target parameter must be either Member or Role')```
!d discord.Object
class discord.Object(id)```
Represents a generic Discord object.
The purpose of this class is to allow you to create ‘miniature’ versions of data classes if you want to pass in just an ID. Most functions that take in a specific data class with an ID can also take in this class as a substitute instead. Note that even though this is the case, not all objects (if any) actually inherit from this class.
There are also some cases where some websocket events are received in [strange order](https://github.com/Rapptz/discord.py/issues/21) and when such events happened you would receive this class rather than the actual data class. These cases are extremely rare.
x == y Checks if two objects are equal.
x != y Checks if two objects are not equal.
hash(x) Returns the object’s hash.
what
tf
@slate swan .
ah thats for his use case, sorry i was a bit confused
thats just for the ENUM, for what target type to use :V
16.06 02:12:14 [Bot] await channel.set_permissions(discord.Object(person1)), overwrite=overwrite)
16.06 02:12:14 [Bot] ^
16.06 02:12:14 [Bot] SyntaxError: cannot assign to await expression
?
!rule 7
7. Keep discussions relevant to the channel topic. Each channel's description tells you the topic.
https://github.com/DisnakeDev/disnake/blob/d813a98b412901becdb87f97986c46f29a1a80b3/disnake/utils.py#L362-L375 saw this method and im going to yoink it, because i will use it later and because im too lazy to do it myself😳
disnake/utils.py lines 362 to 375
def snowflake_time(id: int) -> datetime.datetime:
"""
Parameters
----------
id: :class:`int`
The snowflake ID.
Returns
-------
:class:`datetime.datetime`
An aware datetime in UTC representing the creation time of the snowflake.
"""
timestamp = ((id >> 22) + DISCORD_EPOCH) / 1000
return datetime.datetime.fromtimestamp(timestamp, tz=datetime.timezone.utc)```
await channel.set_permissions(discord.Object(person1), overwrite=overwrite)
7. Keep discussions relevant to the channel topic. Each channel's description tells you the topic.
no.
Oh that won't work I think
Should have known y bot, the rule doesn't apply here any more, cz uhhh u know why
I was just correcting the parenthesis lol I didn't read the code
the param's different for roles and members, discord.Object won't let you know what type it is, mhm
Unfortunate design
Just another discord.py moment
I'm tempted to just ditch sleep to make a more REST friendly version of discord.py
disnake being handy as usual.
okay sire
actually discord moment, the doc I sent is discord docs
No, the fact that you need either a Role or abc.User object
We just discussed this
lmao yeah
Hikari is what discord.py could never be
Ashley is the person who can relate most with this
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: InvalidArgument: target parameter must be either Member or Role
it still says this when i run it
hikari with lightbulb >>>>> dpy and its forks
Well i have no idea what u guys are saying
Check the line, you can debug it yourself.
They said make it discord.Object tho
cannot disagree, i wanna try crescent now
i want to make it so the person whos id i give gets the permission
yes but mine would be a method and not a static function
!pip hikari-crescent slash only command handler with neat design
how can I mention a user? this doesn't work:
f"@{before.author}"
would i do like
member = guild.get_member(id)?
again the reason I love lightbulb more now
or what im so tired now
before.author.mention
yeah
could you stop?
ot, and please keep these things to urself.
but i have 2 people in the command so what would i do
<@&831776746206265384>
Punish him
he's the one spamming. you're helping his purpose
What possess these people to say such things.... 🤦♂️
they want attention.
what would i do for the second command tho
Tushe
its honestly just a statement, they don't have power to actively discriminate against anyone lol, it's not that deep
Lol fair point
Guys, this is not a conversational channel, please keep that stuff elsewhere.
I got a few nasty dm's
for example if the command was .perms id#1 id#2 i'd want to to give both of the members permissions to the channel
you can use two get_members and use that set_permissions method twice 
!ot
Off-topic channel: #ot2-never-nester’s-nightmare
Please read our off-topic etiquette before participating in conversations.
I'm curious if other channels experience the same issues or is this channel just a hot spot
i dont get it, it still says discord.ext.commands.errors.CommandInvokeError: Command raised an exception: InvalidArgument: target parameter must be either Member or Role
overwrite = discord.PermissionOverwrite()
overwrite.view_channel = True
member=guild.get_member(person1)
await channel.set_permissions(member, overwrite=overwrite)
member=guild.get_member(person2)
await channel.set_permissions(member, overwrite=overwrite)
other channels are usually inactive, except for general where these things are more frequent
what am idoing wrong 🧐
Hi
member intents?
i have these if those are what you mean
Well that was 3 hours ago, i forgot sorry
can we not?
henlo
Henlo
Frnd..... Request... 😅
...?
!ban 950887397749575702 Unacceptable behavior. Goodbye.
:incoming_envelope: :ok_hand: applied ban to @limpid knoll permanently.
thank you🙏

Frnd request 😅 accept
Good night guys👋
Good night 👋
I also dk
lets just move on from that lol
👍
is Context.subcommand_passed not None only for groups?
how can i get currently executing group from that same group?
ok
!d discord.ext.commands.Command.short_doc
property short_doc```
Gets the “short” documentation of a command.
By default, this is the [`brief`](https://discordpy.readthedocs.io/en/latest/ext/commands/api.html#discord.ext.commands.Command.brief "discord.ext.commands.Command.brief") attribute. If that lookup leads to an empty string then the first line of the [`help`](https://discordpy.readthedocs.io/en/latest/ext/commands/api.html#discord.ext.commands.Command.help "discord.ext.commands.Command.help") attribute is used instead.
How to use this?
wdym use?
I mean what is the work of it
And how do i set command description
you can look at the source
afaik docstring becomes description
Where do i have use the docstring
in command definition
After async def?
its either description or help
ye
short_doc returns .brief or first line of .help @lyric apex
How do i access this desc in a page?
page?
Means if i want to show that anywhere
command.description
Ohk ty!
when u put a docstring, it is stored in command.help
so use that i guess
or @command(description="...")
this is wrong on so many levels
Lemmie try
dunno, isn't that what a docstring is, I might be wrong probably
okay Im not nvm
Command is not a deco,
if you meant command, then you need to call it - command(),
the docstring is not description but help string,
if used in a cog, then first param is self
huh
I mean, I do know how commands are created ¯_(ツ)_/¯
so do i, and i see no reason to use Command when even the docs explicitly say you're supposed to use a special deco commands.command
I think ashley was showing example
.....? ok and
what should I do
Where is ||Common sense||
fix your example not to confuse newbies
its not like thousands of people are on this server solely for help with discord bots
....?
there're better command examples, imagine still arguing
ok then
is there a way to get command group from that same group?
i have ```py
@commands.group()
async def something(self, ctx): ...
where I'd expect `ctx.command` to return that Group
but the docs say it only returns Command
That command.short_doc worked
y code not work
public static void def discordbot[] {
command = moderation music
logimn discrdbot
end
get out with typescript
wwhat
this is python server
🟦🏃♂️ 
🙃
┬─┬ ノ( ゜-゜ノ)
sussy
ThT isn't a thing, is it?
I never used it
i needed it to add commands to cog dynamically
For using that the ||human needs brain||
Hunt u know, intelliJ is so cool that i'm thinking to develop in java again 
No
so that cog class is created with commands instead of adding them manually which dpy doesnt let u do easily
Hello, how to delete all channels and categorys of a server
Like if user says !cleanserver
it deletes all channels and categorys
please tell me how to implement that in a cmd
please help i need this
Isnt it a nuke?
nuke 💀

nahh
nuke lmfao
loop through channels and delete them
imao why would i nuke
booooooooooooom
u know
i don't have servers to nuke imao
and why would i nuke mine
you can swear here
why u want to do it?
can you show in code pls
for channel in ctx.guild.channels:
await channel.delete()```
anyway yeah just iterate and delete
just for learning
prolly wanna with suppress(Forbidden):
nah lol
Then, no sense for me
Did u checkout Fleet? Damn cool
@slate swan looping through this will get what you want
in future if want to :pepeevil:
there is no human without brain
that'll just stop the execution in case it fails....
it wont if u put it in the right place
So thats what i am saying to нυηтєя#0156
categorys?
ctx.guild.category?
ctx.guild.categories
thanks
!d discord.Guild
class discord.Guild```
Represents a Discord guild.
This is referred to as a “server” in the official Discord UI.
x == y Checks if two guilds are equal.
x != y Checks if two guilds are not equal.
hash(x) Returns the guild’s hash.
str(x) Returns the guild’s name.
bro why 💀
nuke
u helping him for nuke
5. Do not provide or request help on projects that may break laws, breach terms of services, or are malicious or inappropriate.
:pepeevil:
await bot.owner.ban()
If he want to nuke discord will nuke him if he was caught!
if when
that's not a thing sadly
discord is careless if u do report still the user didnt get ban that nuked the server
bot dont own guilds
arent guild owners responsible for which bots to trust?
they can
I would but you know, Jetbrains has copilot lmao
they cant invite someone but
they can
await create_guild(*, name, icon=..., code=...)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).
Creates a [`Guild`](https://discordpy.readthedocs.io/en/latest/api.html#discord.Guild "discord.Guild").
Bot accounts in more than 10 guilds are not allowed to create guilds.
Changed in version 2.0: `name` and `icon` parameters are now keyword-only. The `region` parameter has been removed.
Changed in version 2.0: This function will now raise [`ValueError`](https://docs.python.org/3/library/exceptions.html#ValueError "(in Python v3.10)") instead of `InvalidArgument`.
bots can create guilds if they are in no more than 10 guilds
Bot is a subclass of client lmao
Discord Mostly Takes Action About Users Age not about this nuke they think server nuke is useless info
Oh you want a challenge then
im not sure that nuking a server is against tos
my typing speed's slow af
you pick whom u trust
😔
Everyone improves
Using Bot it is Against developer tos
sad
?
I'm still stuck 😔
learn 10 finger typing
bots can do whatever as long as they are given perms by the owner
I dont even have those many (nvm)
imagine doing that without getting ratelimited., or atleast freq requests

what 💀
i guess if it mentions "malicious intent" or something, then yes
why use 10 finger when you can use 10 toes btw
toes are fingers
exactly
why use hands Or feet
phew
nightmare for me
why even type
a guy keeps bullying me
!ot
Off-topic channel: #ot2-never-nester’s-nightmare
Please read our off-topic etiquette before participating in conversations.
You ruined everything
I'm the worst
google voice to text intensifies
inaccurate still
imagine using it
it makes less typing errors than you tho 
HA it still needs hands to start
Is there text font in bot of different style?
i asked to stop typing not using ur fingers
..
well it is what it is
anyways back to topic or brad will come 😔
I told you I'm slow
Btw you can type using whatever you want
But if you don't use github theme to code then we can't be friend
!rule 7
7. Keep discussions relevant to the channel topic. Each channel's description tells you the topic.
This?
Oh god
we cant be friends if you dont run the rule 7 command ever too 🫂
light theme sheesh
Oh no my eyes, i'm blind now thank you
argh that feels good
:KEKW:
(im not a lightmode user)
just... why
and no, its not a modded client.
wow how
takes birth again
This turns me up
Oh yeah i love you
Whats this
yo
thx :D
O.O
tysm
feels gud
!ot enough
Off-topic channel: #ot2-never-nester’s-nightmare
Please read our off-topic etiquette before participating in conversations.
guys code format looks so cool now lmao
#bot-commands
bru i was looking at the code format in dis new theme
..
Ok let's return to help people to develop a bot without knowing python now
xD
alr 👍
💀
kek
await ban(937608658831966240)
how to get rate limited in 5 lines of code
+1
first the owner told me "noob bot ni**er"
then i ran !r
||you know what happens next||
||boom||
await ban(779990652149825537)
fahking fel gud
1 line better
lambda a:for s in ctx.guild.members await s.ban)
i dont know it works or not lol
I was doing it xD
bruh
are you nuking also xD
No i was converting your 5 lines into 1 line
avg #esoteric-python users
never works.
lambda a:for s in ctx.guild.members await s.ban(779990652149825537)
:)))
im not talking about the syntax, but discord ,
you cant ban the owner.
await channel.delete() for channel in ctx.guild.channels()
this one does
[await i.delete() for i in ctx.guild.channels + ctx.guild.categories]
they both implement .delete
ok stop now enough
it has a ping command, which clearly nobody has
web dashboard
?
Calm down
me after calming down
!ot
Off-topic channel: #ot2-never-nester’s-nightmare
Please read our off-topic etiquette before participating in conversations.
Hey @slate swan!
It looks like you tried to attach a Python file - please use a code-pasting service such as https://paste.pythondiscord.com
Hello
Please help me to fix mistake
import discord
import json
import os
from discord.ext import commands
class User(commands.Cog):
def __init__(self, client):
self.client = client
@commands.Cog.listener()
async def on_ready(self):
print("[INFO] [COGS] Module avatar loaded")
@commands.command(name = "avatar")
async def avatar(self, ctx, *, avamember : discord.Member=None):
userAvatarUrl = avamember.avatar_url
await ctx.send(userAvatarUrl)
def setup(client):
client.add_cog(User(client))
`Ignoring exception in command avatar:
Traceback (most recent call last):
File "C:\Users\yura0\AppData\Local\Programs\Python\Python310-32\lib\site-packages\discord\ext\commands\core.py", line 85, in wrapped
ret = await coro(*args, **kwargs)
File "E:\Discord\SparkleBot\cogs\avatar.py", line 17, in avatar
userAvatarUrl = avamember.avatar_url
AttributeError: 'NoneType' object has no attribute 'avatar_url'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "C:\Users\yura0\AppData\Local\Programs\Python\Python310-32\lib\site-packages\discord\ext\commands\bot.py", line 939, in invoke
await ctx.command.invoke(ctx)
File "C:\Users\yura0\AppData\Local\Programs\Python\Python310-32\lib\site-packages\discord\ext\commands\core.py", line 863, in invoke
await injected(*ctx.args, **ctx.kwargs)
File "C:\Users\yura0\AppData\Local\Programs\Python\Python310-32\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 'avatar_url'`
How do you cast the command? what parameter do you pass when you call it? (in discord)
I don't really understand it, everything is in the code
When you use your command what do you write?
Yeah ash i already know that avatar_url is not a paramater let's work on the NoneType first 😛
,avatar
the full command with the parameters too, like you would do something like "[prefix]command parameters"
it's cog

The rest of the commands work
you are running the command as <prefix>avatar and since the avamember argument is set to None, it successfully triggers the command but fails to execute it since the default value of avamember is None, and None has no attribute as avatar_url, it has to be a Member/User object, run the command as <prefix>avatar @Ashley (mention a member)
ok
||neither member object has avatar_url tbh||
In 1.7 it does
!d discord.Member.avatar_url
No documentation found for the requested symbol.
pretty old
okay it's following the latest docs
The docs are from 2.0
That was a REALLY lame joke
Remorse comes fast
indeed
Can I make it so a bot tracks membercount of multiple servers?
Basically you make a code like put the ID of the servers, and the bot prints their membercount
Sure
How to?
!d discord.Client.get_guild
get_guild(id, /)```
Returns a guild with the given ID.
Changed in version 2.0: `id` parameter is now positional-only.
!d discord.Guild.member_count
property member_count```
Returns the member count if available.
Warning
Due to a Discord limitation, in order for this attribute to remain up-to-date and accurate, it requires [`Intents.members`](https://discordpy.readthedocs.io/en/latest/api.html#discord.Intents.members "discord.Intents.members") to be specified.
Changed in version 2.0: Now returns an `Optional[int]`.
^
No need for that, if it's a command, just typehint to discord.Guild
So,
get_guild(id1, id2)
print member_count?
No
or like
async def leader(ctx):
get_guild()
Hm?
guild = bot.get_guild(id)
print(guild.member_count)
So I have to do different for every server?
guild = bot.get_guild(id)
print(guild.member_count)
guild = bot.get_guild(id)
print(guild.member_count)
class discord.ext.commands.GuildConverter(*args, **kwargs)```
Converts to a [`Guild`](https://discordpy.readthedocs.io/en/latest/api.html#discord.Guild "discord.Guild").
The lookup strategy is as follows (in order):
1. Lookup by ID.
2. Lookup by name. (There is no disambiguation for Guilds with multiple matching names).
New in version 1.7.
how do i make a discord bot leave a serverr by command?
Why do you want that?
i dont have admin powers in that server
i dont have admin powers in that server
That doesn't explain why u don't want that
can you just tell me how do i achieve that?
Well anyways, use ctx.guild and await ctx.guild.leave()
aight
!d discord.Client.leave
No documentation found for the requested symbol.
!d discord.Guild.leave my bad
await leave()```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).
Leaves the guild.
Note
You cannot leave the guild that you own, you must delete it instead via [`delete()`](https://discordpy.readthedocs.io/en/latest/api.html#discord.Guild.delete "discord.Guild.delete").
Only if Danny implemented a discord.Client.leave(discord.Object(guild_id))
imagine still using dpy .-.
or making bots
for discord
I don't. This rewrite gonna be my last rewrite
contrary
im sure you can still discord.Guild.leave(discord.Object(guild_id))
ew
you could just ctx.guild.leave() if you have ctx
yeah
He probably meant smth else
What sarth is saying is if you have a particular guild Id
okay sir
Why use the guild id on a guild.leave method?
Oh wait, nvm
U mean if it's a classmethod?
I believe that's what he meant yes, I'm not sure how it's implemented in dpy
I don't think it's a classmethod
that would work only if discord.py didnt check for _state
nope, i meant providing a discord.Object for self instead of a guild instance.
Ah
like you can discord.Guild.leave(a guild object here)
Who have tutorial video, How to hosting PY bot With VPS ?
idk just i want bot hosting
i have bot with py language
when i hostig .replit i have problem all time.
async def coinflip(interaction: Interaction):
coinlist = ["Heads", "Tails"]
result = random.choice(coinlist)
await interaction.response.send_message(result)```
so im trying
buy a VPS first
like on vultr or linode or something
vultr is cheap ig
I found https://time4vps.com cheaper
i'll see
current_language = "en"
@bot.command()
async def search(ctx):
#Load current lang for picture
global current_language
#Get user input
msg = ctx.message.content.split(" ")
request = msg[2:]
request = " ".join(request)
error = None
try:
wikicontent = wikipedia.search(request, results=20, suggestion=False) #Wikipedia search request
print(wikicontent)
print(" ".join(wikicontent))
#If there are no results
if not wikicontent:
wikicontent ="К сожалению, нет результатов поска на: '{}'.".format(request)
embed = discord.Embed(title="Результаты поиска Википедии:", color=0xe74c3c, description=wikicontent)
embed.set_thumbnail(url="https://www.wikipedia.org/static/images/project-logos/{}wiki.png".format(current_language))
await ctx.reply(embed=embed)
#If there are do:
else:
embed = discord.Embed(title="Результаты поиска Википедии:", color=0, description="\n".join(wikicontent))
embed.set_thumbnail(url="https://www.wikipedia.org/static/images/project-logos/{}wiki.png".format(current_language))
await ctx.reply(embed=embed)
#Handle random errors
except Exception as error:
error = str(error)
await ctx.reply("Sorry, a random error occurred. Please try again.")
print(error)```
Error:
```An unknown error occured: "The "srsearch" parameter must be set.". Please report it on GitHub!```
im trying to make pagination for my help command using discord-ext-menus and im getting this error (given in screenshot)
code: https://paste.pythondiscord.com/uwugesikuz
https://cdn.discordapp.com/attachments/343944376055103488/986729071671132170/unknown.png
It's not a d.py error, try asking in an help channel #❓|how-to-get-help
embeds doesn't have a prepare_once method
so what else should i use?
What do you want to do? 
what is even prepare once?
add pagination to my help embed
lemme send u an good example
ok
i have sub-classed my HelpCommand
what?
from what am i even supposed to choose
which i send scroll down
there's no scroll down apparantly
just type stuff
not for u for dts
oh sorry
type in the categories place there should be some pop up of suggestions choose from there
👍
yeah, i just submitted, it says to wait for 2 weeks to get verified, how will i know once its verified?
they will send a mail probably
I thought u meant Discord Verification and I be like: From when does discord cares about that
they often take months lol
Mine took, idk, 2-3 months
How can I respond to an interaction without any visible output? (I am trying to make buttons and I need to respond to the interaction and I don't wanna make it give an annoying output)
Yo how could i make my on_reaction_add event get the content of this message embed and store the footer of the embed? The thing is that im trying to make the system detect the embed that the reaction came from and store the footer content of that embed
@bot.event
async def on_reaction_add(reaction, user):
message = reaction.message
channel = discord.utils.get(message.guild.channels, name="paid-services")
if message.channel.id == 983745489763725364:
print(reaction.emoji)
if user != bot.user:
if reaction.emoji == "🤝":
embed = message.embeds
you can defer it, or send an ephemeral response ( that will be visible only to author)
ok, thank you, let me see
Yes, thank you :D
# Get the first embed
embed = message.embeds[0]
# The footer content
footer_text = embed.footer.text
oh okay thank you
also, check if the message has an embed first, or this will raise an IndexError
oh
yeah, that too
i will, because this event is only listening to a specific channel there it only sends embeds
so i hope it will still work lol
oh, well if thats the usecase, sure.
Is there a way I can have a view run for a certain amount of time and it doesn't matter what buttons are pressed? For example, I have this thing run for a minute, no more, no less, and during that time, I can press any buttons, if any at all, and after that minute the view will end or I can proceed with my code after said view
views take a timeout kwarg
view also has a on timeout feature which u can use in conjunction with that
async def ping(ctx):
await ctx.send(f"In milliseconds: {round(bot.latency * 1000)}")```
no errors it just doesnt give output
no message sent? do u have intents enabled for ur bot in dev page also by any chance do u have an on_message event?
how do I make a command only work on a specific server ?
@commands.command(name='reniciar', description='reciar o bot')
async def suporte(reniciar : discord.Interaction):
ReniciarEmbed = discord.Embed(title='Code Lab está reiniciando...', description='Code Lab está reiniciando em todos os servidores!')
ReniciarEmbed.add_field(name='O que isso é?', value='Um dos nossos desenvolvedores fez alguma alteração na Code Lab e ela precisa reiniciar para aplicar as mudanças.')
ReniciarEmbed.set_thumbnail(url=thumb)
ReniciarEmbed.set_image(url=codelab_banner)
ReniciarEmbed.set_footer(text='Code Lab Bot')
await reniciar.response.send_message(embed=ReniciarEmbed)
add a check
if reniciar.guild.id == guild_id:
#dostuff
thanks
Use the guilds kwarg btw
Hunter tried hunting penguins, he failed, now he doesn't like penguins
lol
How did u know-
I know everything
How do I make like a leaderboard tho
so the one with most members gets on top
How to make the bot insert the user's avatar in the picture?
how do i make it display the bot's avatar and name at the top
!d discord.Embed.set_author
set_author(*, name, url=None, icon_url=None)```
Sets the author for the embed content.
This function returns the class instance to allow for fluent-style chaining.
embed.set_author(url=bot.avatar.url)
Hmm I thought there was, lemme check
!d discord.Client.user
property user```
Represents the connected client. `None` if not logged in.
it would be bot.user.avatar.url
Ya
now wait
it's also icon_url=
embed.set_author(name=bot.user.name, icon_url=bot.user.avatar.url)
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: AttributeError: module 'discord' has no attribute 'embed'
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: AttributeError: module 'discord' has no attribute 'embed'
it's not discord.embed
the class's name is discord.Embed, but you don't use that
you use an instance of it
which you most probably just named embed
yes
so what did you do
i got discord.ext.commands.errors.CommandInvokeError: Command raised an exception: AttributeError: 'str' object has no attribute 'url' now
then ig you use 1.7
!e
i = 1
if i == 1:
print("o")
@copper panther :x: Your eval job has completed with return code 1.
001 | File "<string>", line 3
002 | print("o")
003 | ^
004 | IndentationError: expected an indented block after 'if' statement on line 2
in your case it's avatar_url, not avatar.url
!e
i = 1
if i == 1:
print("o")
@copper panther :x: Your eval job has completed with return code 1.
001 | File "<string>", line 2
002 | if i == 1:
003 | IndentationError: unexpected indent
#bot-commands
!e
print('test')
@sonic flax :white_check_mark: Your eval job has completed with return code 0.
test
how do i mass delete a server's channels i need it cuz i want to restart my server
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: TypeError: set_author() missing 1 required positional argument: 'self'
one second
I don't think we can help with that
oh
bot.command()
@has_permissions(administrator=True)
async def help(ctx, command=None):
if command is None:
embed=discord.Embed
embed.set_author(name=bot.user.name, icon_url=bot.user.avatar_url)
oh ok
you just set the embed variable to the class
@bot.command()
you didn't actually make an instance of it
why you don't use command group?
what does that mean
how do i fix it
anyone pls..
embed=discord.Embed(title="You have to have something in the embed itself")
@bot.command()
@has_permissions(administrator=True)
async def help(ctx, command=None):
if command is None:
embed=discord.Embed
embed.set_author(name=bot.user.name, icon_url=bot.user.avatar_url)
is that not the sam ething
button.row = new row
