#discord-bots
1 messages · Page 705 of 1
what xd
wrong server
my bad lol
await ctx.send(str(ctx.author))
Honestly I’m pretty sure anything passed into content is casted anyway.
you can probably just
await ctx.send(ctx.author)
and call it a day.
How can I make a cooldown for buttons?
@quick gust your main file is using disnake right?
yeah
well your cog is using dpy and your main file is using disnake that may be the error
tell me if it works or not
alr
yeah it worked, tysm!
anytime 😄
I think I sent an ss of the wrong imports earlier lmfao
you're still dumb tho!
oh lol
yes
imagine thinking that return is broken in dpy smh sometimes i wonder how stupid i can be lol
lmao happens
guys, how can i make a message send every 10m in discord.py
¯_(ツ)_/¯
py
@tasks.loop(minutes=1)
async def my_background_task():
format = '%Y-%m-%d %I:%M %p'
now_utc = datetime.now(timezone('US/Eastern'))
channel = client.get_channel(919746368027918357)
await channel.send(now_utc.strftime(format))
@my_background_task.before_loop
async def my_background_task_before_loop():
await client.wait_until_ready()
my_background_task.start()
i forget how to make it embed with the python syntax or w.e
https://discordpy.readthedocs.io/en/stable/ext/tasks/index.html?highlight=tasks loop#discord.ext.tasks.loop
By using tasks.loop and specify the time which is 10 minutes.
Then have your command below it
#Make sure that your loop started
#on on_ready you should do:
#message_to_be_sent.start()
@tasks.loop(minutes=10)
async def message_to_be_sent():
print("I am cool")
# To send it in a text channel you will need to know the ID of the channel.
# then simply await and send it to channel.
how should i go about defining the channel id
@tasks.loop(minutes=1)
async def my_background_task():
format = '%Y-%m-%d %I:%M %p'
now_utc = datetime.now(timezone('US/Eastern'))
channel = client.get_channel(919746368027918357)
await channel.send(now_utc.strftime(format))
cause i have this, shouldnt this already work no?
That should work, just make sure you start your task.
can you link me in the right direction to figure that out, sorry for asking nobo questions im new to discord.py
try datetime.datetime.now instead of datetime.now
will do give me a minute
Seems like nothing has changed / doesnt work
wait how did you define timezone
now_utc = datetime.now(timezone('US/Eastern'))
Ig he meant timezone("Us...")
i tried to run that in my code but it didn't work
timezone isn't defined it seems.
you got to import it
from datetime import datetime
from pytz import timezone
https://xbb.speedygoat.net/dUJU7/HAbAboMi40.png see this works just fine, just cant get it to send on discord
ffs i literally said that
@slate swan i helped before everyone else
.
welp guess take all the credit lol
smh
yw
sulks
!d discord.on_voice_state_update ||
you sure that occurs when you click a button? do you have an on_voice_state_update(...) event?
discord.on_voice_state_update(member, before, after)```
Called when a [`Member`](https://discordpy.readthedocs.io/en/master/api.html#discord.Member "discord.Member") changes their [`VoiceState`](https://discordpy.readthedocs.io/en/master/api.html#discord.VoiceState "discord.VoiceState").
The following, but not limited to, examples illustrate when this event is called...
yes
everything is correct untill i click the button, than it writes me about error
Traceback (most recent call last):
File "C:\Users\user1\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\client.py", line 343, in _run_event
await coro(*args, **kwargs)
TypeError: on_voice_state_update() missing 1 required positional argument: 'ctx'
remove the ctx
on_voice_state_update doesnt return ctx
Anyone know how to add required permission for a command
@client_main.event
@tasks.loop(minutes=1)
async def my_background_task():
format = '%Y-%m-%d %I:%M %p'
now_utc = datetime.now(timezone('US/Eastern'))
channel = client.get_channel(919746368027918357)
message = await channel.send(now_utc.strftime(format))
my_background_task.start()
i get this error now raise TypeError('event registered must be a coroutine function')
TypeError: event registered must be a coroutine function
every arg is required by default I believe
i think i did something wrong at response
now i click on the button and its nothing happening
!d discord.ext.commands.has_permissions || @commands.has_permissions(manage_messages=True)
@discord.ext.commands.has_permissions(**perms)```
A [`check()`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.check "discord.ext.commands.check") that is added that checks if the member has all of the permissions necessary.
Note that this check operates on the current channel permissions, not the guild wide permissions.
The permissions passed in must be exactly like the properties shown under [`discord.Permissions`](https://discordpy.readthedocs.io/en/master/api.html#discord.Permissions "discord.Permissions").
This check raises a special exception, [`MissingPermissions`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.MissingPermissions "discord.ext.commands.MissingPermissions") that is inherited from [`CheckFailure`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.CheckFailure "discord.ext.commands.CheckFailure").
rremove the @client_main.event
What is the permission for admitstoe
then i get client is not defined
Administrator
administrator? In where
!d discord.Permissions || administrator=True
class discord.Permissions(permissions=0, **kwargs)```
Wraps up the Discord permission value.
The properties provided are two way. You can set and retrieve individual bits using the properties as if they were regular bools. This allows you to edit permissions.
Changed in version 1.3: You can now use keyword arguments to initialize [`Permissions`](https://discordpy.readthedocs.io/en/master/api.html#discord.Permissions "discord.Permissions") similar to [`update()`](https://discordpy.readthedocs.io/en/master/api.html#discord.Permissions.update "discord.Permissions.update").
@commands.has_permissions(administrator=True)
as caeden said
Ty
remove the entire line... it should just be ```py
@tasks.loop(minutes=1)
async def my_background_task():
format = '%Y-%m-%d %I:%M %p'
now_utc = datetime.now(timezone('US/Eastern'))
channel = client.get_channel(919746368027918357)
message = await channel.send(now_utc.strftime(format))
my_background_task.start()
and client should be client_main
if your instance is client_main
what is your bot/client called? (discord.ext.commands.Bot/discord.Client) ps that image isnt loading
client_main
that screenshot basically just says NameError: name 'client' is not defined
File "main.py", line 56, in <module>
bot.run(os.getenv("TOKEN"))
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/client.py", line 723, in run
return future.result()
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/client.py", line 702, in runner
await self.start(*args, **kwargs)
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/client.py", line 665, in start
await self.login(*args, bot=bot)
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/client.py", line 511, in login
await self.http.static_login(token.strip(), bot=bot)
AttributeError: 'NoneType' object has no attribute 'strip'
* Running on all addresses.
WARNING: This is a development server. Do not use it in a production deployment.
* Running on http:/// (Press CTRL+C to quit)
- - [24/Dec/2021 19:09:28] "GET / HTTP/1.1" 200 -
whats that
you need to replace client.get_channel(919746368027918357) with client_main.get_channel(919746368027918357)
oh will try now! I'll let you know
you didnt pass the correct token
hm
you need to copy the bot token and pass it into bot.run(...)
This error appears now AttributeError: 'NoneType' object has no attribute 'send'
WARNING: This is a development server. Do not use it in a production deployment.
* Running on http://172.18./ (Press CTRL+C to quit)
172.18.0.1 - - [24/Dec/2021 19:13:40] "GET / HTTP/1.1" 200 -
Traceback (most recent call last):
File "main.py", line 56, in <module>
bot.run(os.getenv("TOKEN"))
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/client.py", line 723, in run
return future.result()
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/client.py", line 702, in runner
await self.start(*args, **kwargs)
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/client.py", line 666, in start
await self.connect(reconnect=reconnect)
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/client.py", line 601, in connect
raise PrivilegedIntentsRequired(exc.shard_id) from None
discord.errors.PrivilegedIntentsRequired: Shard ID None is requesting privileged intents that have not been explicitly enabled in the developer portal. It is recommended to go to https://discord.com/developers/applications/ and explicitly enable the privileged intents within your application's page. If this is not possible, then consider disabling the privileged intents instead.
172.18 - - [24/Dec/2021 19:13:40] "GET / HTTP/1.1" 200 -```
now this
!intents
Using intents in discord.py
Intents are a feature of Discord that tells the gateway exactly which events to send your bot. By default, discord.py has all intents enabled, except for the Members and Presences intents, which are needed for events such as on_member and to get members' statuses.
To enable one of these intents, you need to first go to the Discord developer portal, then to the bot page of your bot's application. Scroll down to the Privileged Gateway Intents section, then enable the intents that you need.
Next, in your bot you need to set the intents you want to connect with in the bot's constructor using the intents keyword argument, like this:
from discord import Intents
from discord.ext import commands
intents = Intents.default()
intents.members = True
bot = commands.Bot(command_prefix="!", intents=intents)
For more info about using intents, see the discord.py docs on intents, and for general information about them, see the Discord developer documentation on intents.
To enable one of these intents, you need to first go to the Discord developer portal, then to the bot page of your bot's application. Scroll down to the Privileged Gateway Intents section, then enable the intents that you need.
?
919746368027918357 isnt a proper channel id
ty
How to make mobile activity?
it is though, i just verified / copied / pasted it again and even tried a different channel

type; [#919746368027918357](/guild/267624335836053506/channel/919746368027918357/) without the `
can u put code in pastebin
it does redirect me to the correct channel
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
!d discord.Embed
class discord.Embed(*, colour=Embed.Empty, color=Embed.Empty, title=Embed.Empty, type='rich', url=Embed.Empty, description=Embed.Empty, timestamp=None)```
Represents a Discord embed.
len(x) Returns the total size of the embed. Useful for checking if it’s within the 6000 character limit.
bool(b) Returns whether the embed has any data set.
New in version 2.0.
Certain properties return an `EmbedProxy`, a type that acts similar to a regular [`dict`](https://docs.python.org/3/library/stdtypes.html#dict "(in Python v3.9)") except using dotted access, e.g. `embed.author.icon_url`. If the attribute is invalid or empty, then a special sentinel value is returned, [`Embed.Empty`](https://discordpy.readthedocs.io/en/master/api.html#discord.Embed.Empty "discord.Embed.Empty").
For ease of use, all parameters that expect a [`str`](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.9)") are implicitly casted to [`str`](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.9)") for you.
i think its image argument
hmmmmmm, do you need intents to get a channel i wonder...what intentrs do you have?
Hmm thank you
oh i figured it out, it sent once already, i need to verify it will loop i added await client_main.wait_until_ready()
does it say client_main is not defined?
ohh okok
omg I fixed it, thanks everyone for the help
Hey @echo lagoon!
It looks like you tried to attach a Python file - please use a code-pasting service such as https://paste.pythondiscord.com
how long
I had to restart my bot mutliple times
🤷♂️
do you use fetch_guild or anything similar a lot
Nope, only getting 4 Roles and 1 Guild
my code only has 1 command
Don’t use replit
why
can i see the code
Replit shares IPs so if someone else gets ratelimited so will you
ayo fr LMFAO??
I see.. But never had problems since now. Using it for a while now. Is this a new thing in 2.0 ?
dont they have multiple servers?
They can’t make one for every project
Nah it’s not because 2.0. Just a downside of replit
hb like gcp etc. how do they handle that
Why didn't I ever had problems before? Just after installing 2.0 for sum reason
Idk
coincidence,
Probably just coincidence
hmm kk
show ur code
thats not you - replit has a lot of bots being hosted so it often gets ip ratelimited
Where do you guys host ur bots?
oh, wanted to ask is there someway to auto deploy to a pi? like thru github after pushing changes. . .
My code is OK
i used to host one on gcp
when I run it with visual studio it works
Dedicated IPs
I have to use replit unfortunately. Luckily I haven’t had any problems recently.
my pi
you dont host your bot on your computer? i just leave my computer on 24/7
My bot is very small so it’s not worth getting something better
lmao
because your ip didnt get ratelimited, mby its rly a shared ip issue
i see
welp,
if you have a credit card u can put it on gcp for free
Do you have a link?
k tyy
Oh really? Thanks
i did restart this morning after taking that screenshot, needed to do a windows update, also ram usage got out of hand, firefox alone was using 11gigs . - .
but u have to configure it correctly
u have to use n1 micro vm instance i believe
not sure, definitely look into it b4 doing
just have a function in main.py that constantly asynchronously runs git status - if it decets a change it runs await restart() ```py
import os
async def restart() -> None:
await bot.close()
os.system('python main.py') #to rerun```
ah thanks!
it has to pull the code as well
@echo lagoon do you want to push on ur computer and have it update on pi automatically
basically, yes
thanks!
Hello enslo
hello
same shit
guess that works, i already have one for a command
when it gets update from github it pulls and restarts the bot
no you have to make an endpoint and configure github to send post request to that endpoint when you do git push
o h, thought you meant on the computer, got an image upscale command which requires a beefy gpu, already set up a restful api, where it handles the task ...
no, you have to make a rest server on the. pi

pi has to listen for requests from github
hell yea
hi adx
a h, could i not do it the other way around, where the pi queries github?
my bot is in 98 servers first week
gotta do sum verification shit now
ow nice!
its probably more efficient and more accurate if github tells the pi when code was pushed, not if you constantly have to ask github if there were any updates
true, guess thats the best way. . .
its always up to u, do what you find better
i just told u my point of view
ye, ill see what works for me. . . dont think ima move my bot to a pi just yet either. . . couple things to sort out
because you have some weird fucking bot that appeals to horny little shits
apologies for my language
is it the autonsfw bot 😂
yeah...
0.o
LMFAO
i mean thanks for trying but it doesn’t explain what is bot
hell yeah the names of those servers are very weird
there isnt any bot
autonsfw
:/ auto sends nsfw content
. - .
Basically it spamms porn
yes
how do you select a channel?
in dpy server it says this
async def get_pre(bot, message):
return "prefix" # or a list, ["pre1","pre2"]
bot = commands.Bot(command_prefix=get_pre ...```
the callable will be called on each command process, and can return something different each time
they have a directory with files for each channel the bot is in i believe
🤷♂️ i only used the method in docs
ah,
but ig the bot is commands.Bot if anything
just moved all channels to 1 file tho
LMFAO bro why didnt u use a db
^
^
^
^
^
^
^
^
^
cuz dbs are overcomplicated for a person like me, I've never actually published anything else, I just do these as my own private projects
overcomplicated … 
and didn't bother to learn db usage now either
private projects
porn bot
its easy istg, way easier than json 
so he could have some romantic tome on discord
right now - what would your parents say if they saw it?
nah bro I meant that I usually make these as private projects
I dont make porn for my self dude
disowned 
Lmao, the fact that its ur first time doing something like this and it uses files to store data and u got 98 servers in less than a week just cus its a porn bot
kinda concerning
the amount of horny little fucks on this app...
imagine dude becomes a millionaire
😭
hm I might just send the file where all server names are stored here
uhh looks at my hen..i commands
mby this is the right path to take in bot deving
LMFAO
hate to be this guy but... probably time to steer back on topic
agreed
.topic
Suggest more topics here!

hmm
probably the help channel thing
the way you type in a help channel and it makes it occupied and then it closes after x minutes etc
thats pretty cool
integrating it with other apps or games
moderation features
what moderation features are you after? they're all pretty easy
idk
automod is kinda fun
haha
nah too hard to get it right
welp, other bots do it fairly well already
it works well if you tweak some values
maybe less moderation feature but probably some server backup / template bot
oooo
nah dude its literally impossible to get it right
wdym
i have an archive command, archives the last x amount of messages in a chat (creates a new archival channel), great if there was a fight or something, and you wonna back it up then delete it
trading/marketplace or globalchat
what did i just walk into-
ohh, yes global chat is cool
cool bot ideas
ikr very interesting as well
features
if the automod detects if word x is in word y it would raise error at 'circumcission'
if the automod detects word x == word y it wouldnt raise error at 'fucking' its so hard to get it right
u walked into everyday discussions at discord bots channel
i may do that for fun
kinda. yaggdrasil thingy but nicer
lol
an open source token 😎
its not everyday that i see porn being discussed here. but yeah
nothing.
ima just walk away lol
you said what?
my tokens open source if you can find it
those welcome message with image manipulation rly payed off
mathematically embedded into my code
lmfao, parents must be proud as well 😂
huh?
smort
dw i was jk
waifu search command 
make the token of ur bot open source
jk, dont
.topic
Suggest more topics here!
add back verified dev badge
enslo for president 2024
is that not a thing?
was
used to be
how were u able to get it
by doing what u did in less than a week
ah
What even happened here-
were = past
my bad i forgot english isnt my native language
same
can someone just ask a help question
Are = present. You are a discord user
dude what, I was looking thru all the discords my bot is in, this is one of the names
"that one sad homo's server"
bot = commands.Bot(command_prefix=";",activity=discord(type=discord.ActivityType.watching,name="you half-drunk happy"),help_command=None,intents=discord.Intents().all())
!ot
Off-topic channel: #ot2-never-nester’s-nightmare
Please read our off-topic etiquette before participating in conversations.
wrong prefix
😂
Traceback (most recent call last):
File "main.py", line 10, in <module>
bot = commands.Bot(command_prefix=";",activity=discord(type=discord.ActivityType.watching,name="you half-drunk happy"),help_command=None,intents=discord.Intents().all())
TypeError: 'module' object is not callable
welp, gonna make a music bot, anyone got a good guide?
anyone know what i did wrong?
discord.Activity
docs probably best guide
its discord.Intents.all()
^ yeah that too
remove () from Intents()
thx, other issue i had last time was getting all urls from a yt playlist,
Also please follow pep-8
it was hella slow
__builtins__['print'](str((__0__:=lambda: None)==((_0:=1),)).replace('False', '') if True is True else True is True, end='');_:__import__('typing').Callable[[str],str] = lambda m=None: True if m is False else False; print.__call__(bool(''.join(list(map(lambda __m__: __m__.lower(), str((__:=(_,))[0](True if (___:=lambda e=None: _())() else (_)==(_)==[_])))))))
``` like this?
the story about the developer badge
-> https://support.discord.com/hc/en-us/community/posts/360051569573-Developer-Badge
that we are not allowed to help with here cus its against youtube tos
That's esoteric, which is also very cool
what is that
pep8 101
o h, i understand. . . didnt realise
pep9*
my esoteric snippet : )
well 1 problem, there is nobody in my support server lol
!ytdl
Per Python Discord's Rule 5, we are unable to assist with questions related to youtube-dl, pytube, or other YouTube video downloaders, as their usage violates YouTube's Terms of Service.
For reference, this usage is covered by the following clauses in YouTube's TOS, as of 2021-03-17:
The following restrictions apply to your use of the Service. You are not allowed to:
1. access, reproduce, download, distribute, transmit, broadcast, display, sell, license, alter, modify or otherwise use any part of the Service or any Content except: (a) as specifically permitted by the Service; (b) with prior written permission from YouTube and, if applicable, the respective rights holders; or (c) as permitted by applicable law;
3. access the Service using any automated means (such as robots, botnets or scrapers) except: (a) in the case of public search engines, in accordance with YouTube’s robots.txt file; (b) with YouTube’s prior written permission; or (c) as permitted by applicable law;
9. use the Service to view or listen to Content other than for personal, non-commercial use (for example, you may not publicly screen videos or stream music from the Service)
what even is esoteric?
dang
yes, the library youtubedl used to download stuff from youtube is against youtube tos
haha fuck this im not gonna even verify
esoteric means weird and cursed code which works or messing with internals to do unusual and cool things
not gonna send pic of my passport to discord bruh
LMFAO
ah i see well that is very cursed
dudes dreams got crushed
does anyone know how i can make my bot status the mobile icon?
Please go to an off topic channel
or at least the variable for it?
its on topic
?
we are talking about discord bots
^
.
I don't think you can, there was some bug that caused that
lemme. look in docs brb
class discord.Status```
Specifies a [`Member`](https://discordpy.readthedocs.io/en/master/api.html#discord.Member "discord.Member") ‘s status.
is it morally wrong to collect data, names of nsfw servers?
!d discord.Activity
class discord.Activity(**kwargs)```
Represents an activity in Discord.
This could be an activity such as streaming, playing, listening or watching.
For memory optimisation purposes, some activities are offered in slimmed down versions:
• [`Game`](https://discordpy.readthedocs.io/en/master/api.html#discord.Game "discord.Game")
• [`Streaming`](https://discordpy.readthedocs.io/en/master/api.html#discord.Streaming "discord.Streaming")
Well, if you are collecting data, you should inform the users that their chat messages are collected
thank you!
those. are only statuses u can set for the bot
ahahahah what someone named thier server "Homework Folder" and invited my nsfw bot into it
LMFAO
can someone explain how a bot has no status but still works? would like to know
?
i have no status and i still work
its invisible 🤷♂️
a bot doesnt need a status
since when do you need a status to work
!d discord.Status.offline || or do you mean this?
The member is offline.
status (Optional[Status]) – Indicates what status to change to. If None, then Status.online is used.
How can I ignore any other commands which were sent that are not in my code? If I only have !lol as a command. And ppl type !hello. It gives me an error that it doesn't exist. How can I completely ignore that?
if its none, it will show as online
I think there was a bug that allowed bots to have the mobile icon status
error handling
lemme send u link
I saw that in few bots, but I never really looked into it
use on_command_error, check for the command not found isinstance and pass it
k tyy
https://discordpy.readthedocs.io/en/stable/ext/commands/api.html?highlight=on_command_error#discord.on_command_error. this event gets triggered when command fails and raises an error
confusing
is there no documentation for it
@patent lark hereis the docs for it
ah
There is
then why didnt the command work lmao
It's a bug then
idk
I've never used an error handler. How does it work?
the doc will explain it
k ty
the event will be called on any raised exception
so when an exception is raised, you can handle, whether you choose to ignore it, or even send an error message is up to you.
Okay, we've made it to part 12! Be forewarned, this is going a long one. This part is going to be about how you can make error handlers for your commands, like you saw briefly in the previous part about cooldowns.
under global error handling @silent portal
k ty
this is what i ment andy explained it to me but i dont quite remember
how do I mimic this functionality https://support.discord.com/hc/en-us/articles/211866427-How-do-I-upload-images-and-GIFs-
As in create a tkinter GUI that allows the user to drag and drop images and then convert them to discord attachment links
I lost you at
create a tkinter GUI that allows the user to drap and drop images
jesus bloody christ you're ambitous
i think this bot is open source,its by andy, check his github
oh its just a GUI to let the user drag and drop multiple images
i mean doing that with a discord bot is pretty hard
yk ur making a discord bot ight?
not really more like a small program

look at the channel name rq
then why you here
people in here are gonna be more informed on discord development
even if the channel name doesnt exactly match
i think it was that the bot was connected to the gateway but just wasnt taking request idrk
like for example I already asked this in other channels and its dead
no
what are u trying to do? integrate ur app w discord?
sorry,i dont remember what he said hes always explaining stuff in big paragraphs 
i believe only discord can create discord attachment links
I feel like maybe its an API?
yeah
that can only be generated by discord
Just upload it into a test server and copy the link
this way discord kind of acts like a google drive for you
or make ur own server where u store media and give em some link
but ud need a domain
and idk how it would work if u sent the link in discord
yeah it just displays as any image here would
you cant rly save media to discord's servers without sending it in discord
you would have to save it to ur own server and give it ur link
and server not as discord server
more of a rest server where u can upload and get media from
@untold token so i guess we were using the incorrect symbol, thats why the documentation refused to pull up
rather than discord.on_command_error. it should have been discord.ext.commands.Bot.on_command_error
Oh
Oh
Oh
Oh
Oh
With the new timeout feature in discord is there any way to manipulate it with a bot?
Ping me with response
Add a file upload functionality, generate a UUID for each file, store the UUID and the file's data.
?
wdym ?
Do the inline fields of embeds not work on discord Mobile
If you mean that you can use the feature with discord bots, you can, at least with disnake 2.3.0
Which is a fork of dpy
prob not
nothing works on mobile
rip nitro
the way i only use discord on mobile and only ever go on pc whenever i need to change the banners of my servers or code my bot etc. 💀
I use discord to make roles and PC to code lol
lmaooo
oh yeah and changing the color of roles by hex codes cus u can’t do that on mobile (yet)
I never do anything on mobile apart from trash talking splitgate players and scrolling through reddit lol
are most popular bots made with discord.py or discord.js
Disnake has support for it
prob discord.py but hard to tell
.js
oh?
I doubt they'll be written in dpy lol
Most have their own wrapper I believe
Dank memer is written in .js I've looked through source code
None
do you mean python/json or discord.py/discord.js? if so, discord.js ofc - its the only good js wrapper
It's by far not the only good wrapper
meh nodejs is irrelevant who gives a shit about it
!ot-names || before you correct me 😳
Off-topic channels
There are three off-topic channels:
• #ot0-psvm’s-eternal-disapproval
• #ot1-perplexing-regexing
• #ot2-never-nester’s-nightmare
The channel names change every night at midnight UTC and are often fun meta references to jokes or conversations that happened on the server.
See our off-topic etiquette page for more guidance on how the channels should be used.
Idk why anyone would use node.js
is winRAR
naw won't correct you bro
!d disnake.Member.timeout if your using disnake
await timeout(*, duration=..., until=..., reason=None)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).
Times out the member from the guild; until then, the member will not be able to interact with the guild.
Exactly one of `duration` or `until` must be provided. To remove a timeout, set one of the parameters to `None`.
You must have the [`Permissions.moderate_members`](https://docs.disnake.dev/en/latest/api.html#disnake.Permissions.moderate_members "disnake.Permissions.moderate_members") permission to do this.
New in version 2.3.
what is replit run on?
"manipulate it" lol
yeah i was confused
elaborate?
i’ve heard of disnake and other things like that
You can choose what to install I believe.
so i’m wondering what replit discord.py uses
…
also is it bad to use replit ? 😭
im very confused?
It's a normal python library, choose which one to install
nvm lmaoaoao
…
And yes it's indeed bad to use replit
ohhh i chose the most recent one
?
read that
"is dpy run on replit"
LMFAOOO
oh
you did not😭
IM NEW TO THIS OKAY? 😭🧍♂️ /nm
*replit
use vsc or something else
i don’t wanna type everything all over again
easier with pycharm my guy
alr
it does it more efficiently
yes:
ctrl a + ctrl c + ctrl v
no
it’s that easy?
it's not
o
yes
kinda
it is
LMFAOOO
you need to have the folders and everything
o
he fixed it finally
am i wrong
if you've got a few folders it's fine
naw he just finds it funny
No, u are correct
hard and it eats allot of ram
ik
however if it's lots of files we have a problem
lol
vsc is more light compared to pycharm
Cant u copy the whole folder
hes starting how much folders would he have jeez
oh
just use my method lol
I didn't know that, sorry 😦
yeah it's the best method
ik
@shrewd inlet you store your token in a .env file right🕴️
If u were to have a lot of folders it would be nice if u could download it
good in vsc you dont since its not public
ah bet
yes
Yes u do
If you push it to git
wdym🕴️
git
you say that after i leak my own token🚶
🕴️
I'm gonna leak it rn
No like, u use .env locally as well
ill get a msg lol
You dont hardcode the token
it's ||never gonna give you up, never gonna let you down, never gonna run around and desert you||
ill probably just store it in a py file
🤬
Or that, and put the file in .gitignore
yep
ill store it in a py file later
merry crismis
Merry Christmas
merry chrutmais
.topic
Suggest more topics here!
hurrr, maybe shortcuts for code?
Wdym
he means for dpy 😭
yeah
custom status for bots would be funny
I dont want to do async def unban
yeah lmao
What do u wanna do…
Shush, I wanna hear it
it is
I don't want to do
@bot.command()
async def unban(ctx, member:discord.Member):
...
I just want
@bot.command()
async def unban(ctx, member:discord.Member):
await unban(member)
dpy only knows its a command because of the decorator on top of it the rest is just a async function 😭
Tell me what u want
i think he wants like
@bot.command(ban member reason)
await ban(reason)
or something idk
just doesnt make sense
You have to specify a reason
Either in ur message or you can specify a one in ur code
LMFAOOO
?
yeah I know, but I just want an unban command
naw it's not what I want
If he wants one. I don't quiet understand what his problem is
I would like an unban command like the await ban() command
it would be nice
and custom status like what @slate swan said
He wasnt asking a question, we were discussing how he could get rid of defining a function to create a command
Ohhh ok sorry
!d discord.Member.unban
like lambda maybe
await unban(*, reason=None)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).
Unbans this member. Equivalent to [`Guild.unban()`](https://discordpy.readthedocs.io/en/master/api.html#discord.Guild.unban "discord.Guild.unban").
Dwdw
owo
Asynchronous lambda?
There is no such thing
ik
what am I looking at
thank you
Np
@velvet tinsel something like this?
async lambda ban: ctx member: discord.Member reason await member.ban(reason=reason)
♥️
ikr
Wait- There's nothing for display_banner ?
SyntaxError: invalid syntax
now what the fuck am I looking at
ik chill😭
i only make cursed stuff
wouldn't that be cool tho?
But there it wouldn’t do nothing
ik lol i wish it would
It’ s not registered as command
that to
Current implementation is nice
yes
stealing from custom help command code is nice
wdym
Lmao
just copy pasted code from https://gist.github.com/InterStella0/b78488fb28cadf279dfd3164b9f0cf96
oh you mean to subclass the help command
yea i really dont understand anything that happens in the custom help command
so I just copy and pasted instead
You basically make a new class that inherits from HelpCommand so you can overwrite It’ s methods
yep
i should really learn oop
Mhm
idk just the sound of classes gets me demotivated and my brain dies
i only understand oop becaude of dpy lol
do half of a MOOC
their actually really handy and easy
I love classes
time to travel to freecodecamp oop video
@sour lodge
too many words
Bro
Video has too many words + media + 2h time + ads skippable after 6 sec
oop isnt really hard its just like legos
https://www.youtube.com/watch?v=Ej_02ICOIgs is this good enough
Object Oriented Programming is an important concept in software development. In this complete tutorial, you will learn all about OOP and how to implement it using Python.
💻 Code: https://github.com/jimdevops19/PythonOOP
🔗 Tutorial referenced for a deeper explanation about repr: https://www.youtube.com/watch?v=FIaPZXaePhw
✏️ Course develo...
in a way
In your opinion, what is the best way to format a help embed?
wdym format?
Like how the embed looks, as in how the description of it is formatted.
Yes.
Subclass HelpCommand
Make the multi page thingy with select menus
for tutorials the shorter the better cause no one is motivated enough to complete a MOOC
Articles or docs are probably the best
Or written guides
right but for something like OOP watching a tutorial + doing your own demos is great
since its like a larger concept
am i the only one that makes a new command named help?
You have code examples and even some challenges
ur not i did it too
Make multi page
all preference
how 
👍
lol
Use select menus
but how ;-;
i’m gonna search up a tutorial for it
I could not find a good video that explained select menus in python from the beginning to the end so I made this video to hopefully help people. If you have any questions feel free to ask. I am using VS Code as my IDE for this project.
pip install discord-components
View the code:
https://github.com/erobin27/Tutorials/blob/main/DiscordYT/Selec...
this should work
or i could make a site for the commands
a site that shows all the commands
some bots do that and i think it’s cool
Those are pretty cool
yep
i should learn menus
why?
But if you got it, it's easy
Idk the whole "new" Discord's interaction system is kinda different
I have to get used to them
I don't like using new things
that's why I never really learned them
ive done buttons and tbh its not hard
ive done slash commands buttons
i think i got it
I never tried slash commands. I just think they're kinda useless imo
pretty easy
nice
But I like how Discord is adding more and more features for bot devs. There are more possibilities everytime and you don't get "bored"
Why don't u develop Custom bots for different servers?
idk
Not many servers have them. And I think it's kinda cool
idk i just dont lol
that's ok :) But you should try it
meh
With developing for a different person you expand ur skills
i mean yeah i could but i dont do jobs or payed jobs i just make bots because i like doing them
you have a point
Well you don't have to get payed, I do it for fun aswell
ppl have different reasons for developing. You can have multiple at once aswell
yeah
yep
gtg enjoyed the talk
all good :) Have a nice day
you as well, merry Christmas
❤️
!d disnake.ui has great support for components
No documentation found for the requested symbol.
!d disnake.ui.View
class disnake.ui.View(*, timeout=180.0)```
Represents a UI view.
This object must be inherited to create a UI within Discord.
New in version 2.0.
!d disnake.ui.Select
class disnake.ui.Select(*, custom_id=..., placeholder=None, min_values=1, max_values=1, options=..., disabled=False, row=None)```
Represents a UI select menu.
This is usually represented as a drop down menu.
In order to get the selected items that the user has chosen, use [`Select.values`](https://docs.disnake.dev/en/latest/api.html#disnake.ui.Select.values "disnake.ui.Select.values").
New in version 2.0.
I use it lol
thats why i said its easy
Nicee
ikr
I love views
Same
class disnake.ui.Select
is dis sme nike or rebbus?
Oldie but goldie! Hahahahhahahaha hahahah Dominican style hahhhahahhhh !!!!! 😂😂😂😂😂😂😂 Been watching this video at least 5 times a day now for 3 days straight. I can’t stop laughing! Lmao. Too damn funny. With SUBTITLES.
Radio DJ Spanish speaking finds song Rhythm of the Night / "This is some reebok or some nike"
Unusual song request from one of...
hopefuly u all have alaugh
You're watching the official music video for Corona - "The Rhythm of the Night" from the album 'The Rhythm of the Night' (1995). "The Rhythm of the Night" was a hit on European and dance charts and sampled in Black Eyed Peas and J Balvin "RITMO (Bad Boys for Life)"
Subscribe to the Rhino Channel! https://Rhino.lnk.to/YouTubeSubID
Check Ou...
@lapis lintel send their docs link please
what has happened to this channel?
i dont get it, why is testing this in non nsfw channel returning 0. . .
item = anime_links.anime_global[text]
if (ctx.channel.is_nsfw and (len(item[0]) > 0)):
index = 0
else:
index = 2
url = utility.get_random(item[index])
return await ctx.send(f"`{item}`\n\n`{url}`\n\n{index}")
What is item[0]
the nsfw link, while 2 is sfw link,
Why did you do len(item[0])
there are certain ones with only sfw links, no nsfw, so it will instead send sfw if empty
Is item a list?
yes, as shown here (the ss)
So basically list with 2 elements
4,
first is nsfw link, with an nsfw phrase, then an sfw link and sfw phrase
And item[1] will always be 2nd element in a list
mhm
If there is only 1 element, it will be an error
it will always have all items in the list
Ok
Btw in python u dont need to put if statement conditions in ()
ye, coming from c# its kinda a habit
I want the bot to send something in dms to a user, how do I get the bot to read the response?
Try removing ()
tested with just this, same issue. . . channel im testing in is definitely not nsfw
if (ctx.channel.is_nsfw):
index = 0
else:
index = 2
Try removing () just in case
And print out channel.is_nsfw
!d discord.Client.wait_for
wait_for(event, *, check=None, timeout=None)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).
Waits for a WebSocket event to be dispatched.
This could be used to wait for a user to reply to a message, or to react to a message, or to edit a message in a self-contained way.
The `timeout` parameter is passed onto [`asyncio.wait_for()`](https://docs.python.org/3/library/asyncio-task.html#asyncio.wait_for "(in Python v3.9)"). By default, it does not timeout. Note that this does propagate the [`asyncio.TimeoutError`](https://docs.python.org/3/library/asyncio-exceptions.html#asyncio.TimeoutError "(in Python v3.9)") for you in case of timeout and is provided for ease of use.
In case the event returns multiple arguments, a [`tuple`](https://docs.python.org/3/library/stdtypes.html#tuple "(in Python v3.9)") containing those arguments is returned instead. Please check the [documentation](https://discordpy.readthedocs.io/en/master/api.html#discord-api-events) for a list of events and their parameters.
This function returns the **first event that meets the requirements**...
not nsfw channel is returning as nsfw
Remove ()
nice, detective conan
How would I put that in an if function then?
I love that manga + anime
Same way it states in docs
thanks!
dang it, same thing. . .
msg = await bot.wait_for(...) if msg == ... do stuff
wait a min, is is_nsfw a method? maybe parenthasis?
Print channel.is_nsfw
I dont think so
ive never used nsfw lol
!d discord.TextChannel.is_nsfw
is_nsfw()```
[`bool`](https://docs.python.org/3/library/functions.html#bool "(in Python v3.9)"): Checks if the channel is NSFW.
my search history would be sus if I started googling it
alr it's a bool
So like this?
response = await self.bot.wait_for(code)
if response == code:
Print it to see what it returns
yeah
There is an example in the docs

ah got it, it was a method, required parenthasis at end of is_nsfw()
But I only want it to work in dms
thank you!
It’ s a method?
apparantly
it still works
Ok
Yes, I checked in the docs, not the !d thingy
response = await self.bot.wait_for(code)
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: AttributeError: 'int' object has no attribute 'lower'
.-.
You can't lower case a number
remove the lower
why did...why did you put code
wdym
It's a variable
code = random.randintt(1111,9999)
oh
why...why did you put a random in a wait for
I assume you tried to do .lower but it's a string method which won't work for numbers
bruh
Also it did not make sense to try lowering a number because they don't have upper case/lower case
you dont do that
you dont "wait for" a randomly generated number
you put it in a var
A for effort though
no ... that just an error discord raises because it expects the arg to be an str not int
!d discord.DMChannel ||
await self.bot.wait_for('message', check=lambda m: isinstance(m.channel, discord.DMChannel)) - this waits for a message to be sent.
check=lambda m: isinstance(m.channel, discord.DMChannel)
this just makes sure thatm.channel(which is an instance ofdiscord.TextChannel) is in a dm.
class discord.DMChannel```
Represents a Discord direct message channel.
x == y Checks if two channels are equal.
x != y Checks if two channels are not equal.
hash(x) Returns the channel’s hash.
str(x) Returns a string representation of the channel
How do you lower case a number
Merry Christmas!!
His goals are beyond our understanding
merry Christmas :))
guess so
what do you want to achieve exactly?
you can do
#command stuff
...
a = list(range(1001))
if message.content in a:
...
a will be list of int
as I said before, he didnt lowercase an int. discord tried to do .lower() on an arg that was typehinted to str. The lib threw that error, not him.
idk why the fuck you did list( on a fucking list
!e print(range(10))
@manic wing :white_check_mark: Your eval job has completed with return code 0.
range(0, 10)
!e py nums = range(10) if 1 in nums: print(':O')
@manic wing :white_check_mark: Your eval job has completed with return code 0.
:O
idk probably in a project i tried printing out a range and i got this
^
and so i did this and mixed it up
!e
print(list(range(11)))
@slate swan :white_check_mark: Your eval job has completed with return code 0.
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
yes
alr lol
you're comparing message.content (str) to a (list[int]) which wont work
that's what it's repr defaulted to
wait even if the content is a int dpy makes it a str?
Objects/rangeobject.c line 638
return PyUnicode_FromFormat("range(%R, %R)", r->start, r->stop);```
if you dont time hint it it makes it a str right
how do you know that🕴️
if you havent even seen my params🕴️
message is from a wait_for isn't it?
idk is it🕴️
dont know what your talking about lol🚶
"I just want the bot to wait for ..." then you gave a code with message and range stuff

do you want me to ask him his social security number as well?
for you
yes ask him for me
why dont you doesnt that seem impolite 
yeah it is
pikachu?
im innocence so no thanks
then tell him
since when were you here?
makes sense
yeah your very
jeez i make a mistake and you guys die for a reason smh
we all make stupid mistakes especially me
hi
hi
you like zt so much?
who?


