#discord-bots
1 messages · Page 704 of 1
Maybe we should destroy the sun
Yes!
Its not the sun?
We should destroy the universe
🕴️
When the earth spins, the sun rises and sets
!ot
Off-topic channel: #ot2-never-nester’s-nightmare
Please read our off-topic etiquette before participating in conversations.
No because of earths rotation
Okay, Let’s destroy earth
Now back to topic
No because the earth rotates it changes daylight
Yeah so discord bots, haha
Is there a way to update code with out saving?
Pretty cool right
No way Jose
timezone sucks, use Unix timestamp, no timezones 👍
Nope
Not a chance
Just make a downtime lol
Is there a way to update your bot without restarting the bot but actually updating the code?
But there is one IDE that does it
We already said twice, no
cog reload
But it’s for js and it’s stupid
EXACTLY
Or just edit the code stop the terminal save it and run it and youll be good
icy is right
But you still have to rerun the cog
Yes but not the bot
Technically when you rerun the cog the bot is updated
Yes
But it’s not restarted
discord bot
I mean yes but you have to be more specific for whay you want
Reddit bot 😳
telegram bot?
ps4 bot
Twitter bot
😫😫😫😫 so many bots
I was gonna make a scratch API
mark zuberberg bot
to destroy scratch
@bot.command()
async def reload(ctx):
await bot.reload_extension("cog")
oh hi dek
Yes
Maybe it’s hekarus problem 😭
Because hekaru sucks?
Hekaru 😳
I think you can just unload the cog and then edit it and then load it
Hacker?😩
Cool
Yes, that would work too
Never tried it but makes sense
Merry Christmas y’all
I haven’t noticed it was Christmas Eve until I asked Alexa
;-;😣
Better get going with the cogs then
;-; 😣 😖
Can you date discord bots
I should be making cogs
Yes i dont see why not
sure if u also a bot 😣
yeah ig
thats crieng 😣
Bro that anime was fire
!ot ahem ahem
Off-topic channel: #ot2-never-nester’s-nightmare
Please read our off-topic etiquette before participating in conversations.
Nino better than itsuki tbh
You probably like yotsuba
worst python pun ever
Zero two 😳

he likes miku


i like nobody
Ay miku is good🕴️
anyways
I would say someone but then you probably never heard of them
👍
Alr
What’s going on
i have no idea but i am lurking in #discord-bots for no reason, here's a wave :]
🕴️ hey
Cool
!ot 😣
Off-topic channel: #ot2-never-nester’s-nightmare
Please read our off-topic etiquette before participating in conversations.
Someone ask a question
Ikr
how do you fetch a message with it's id
I dont understand the custom help command in discord.py
help_command=False, it’s a kwarg in commands.Bot
K, I’m thinking of the solution
ctx.fetch_message(msgID) msgID is an int
!d discord.ext.commands.Context.fetch_message
await fetch_message(id, /)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).
Retrieves a single [`Message`](https://discordpy.readthedocs.io/en/master/api.html#discord.Message "discord.Message") from the destination.
thanks
don't date discord bot
nahhh
date google assistant
Why
:uwu:
Give me one good reason
for?
using disnake on replit doesn't work :[
Dating Google assistant
That’s cos it is replit
bro i have ok google at my home, but im not in my native country rn
Alexa is cool
its kind of like a mix between alexa and google assistant
Date a discord bot, who would you choose 😳
troll bot :]
don't date a discord bot
Zero two bot
👀
me?
Okimii, and you
is my reddit name
im not active on reddit dms and that shit tho
i use discord more
Ok
Off-topic channel: #ot2-never-nester’s-nightmare
Please read our off-topic etiquette before participating in conversations.
i deleted my message containing my reddit acc name
🤔
You cant get a msg since the bot doesnt cache a new message so it needs to be fetched and make an api call right

Too late I screenshotted it
what are you gonna do with it
imagine someone lurking
Sarthak!! Hiii
Hey dekriel
Hru
🕴️
not too good
I have 2 bots to write and have been travelling for 8 hrs
Yea
Unless you cache it manually
I’m terrible
Do you mind if i ask why?
Why?
Ic
Because…I have 4 projects to work on and I’m busy af
Dang
Yeah
As I said I've been traveling for 8 hrs lol
🏃♀️ Omw to grandma's
One of them I’m having to do HTML
Ah grandma are the goats ofc
you guys make websites for your bots?
How painful is that
grandmad
No. Not a chance
I was thinking to make a GitHub wiki on the bot's repo instead
issue is how would i host it
You good?
Nice pun
Similar to what vortex bot does
GitHub pages / vercel
Hosting is not a problem for me
I'm too lazy to write in html
somehost.xyz
i used to use replit
Shame on you
Im to lazy to learn html tbh
💀
html is ez , css makes it crazy
Good thing i never did
I’m not learning html I’m Googling everything
I went from the idle to vsc lol
i went from vsc to vsc
I’m learning JavaScript, I taught myself functions, variables and printing
However I haven’t even bought a book yet
🤝great progress , I never had idle
Js is easy when you know python tbh
Because I’m Not that smart
True

If i have a class that gets called from another file how do i use await functions without having to do smth like on_message
I downloaded VSC on a Mac because it had IDLE in my school PC
You want commands in another file aka a cog?
when do you want to call it?
Me who uses Linux and had python pre-installed
Imagine having linux
I have my own PC, but it’s windows
I want Linux but I don’t want to stop playing splitgate
dual boot it
🕴️
🕴️
You can have as many is as you want on the same device tho
*os
it's like 3.4gbs right?
Yes
One of the owners in the Java discord server likes darling in the franxx lmao
Make a cog and…load it?

have yall ever attepmted modmail
A man of culture i see
Nope
Nah , I hate things when you need to use wait_for or dbs
Same
Kinda over complicated
wait_for is fucking complicated
Not really
make a function to check, figure out how to check mag content, blahblbjakgj
Yes
what does the msg kwarg in bot.wait_for do
Wait for is easy af
atleast we don't need to use an listener lol
Msg ?
Bro I don’t get what you don’t understand lmao
!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**...
isn't it event
huh
Maybe he means “message”
no
check is easy as well
I don't watch it
Just use lambda
Yea I get it , but there's no such kwarg
What do you mean
Me too
i think kayle told me there was a msg kwarg
i do that
No but after it is loaded i call the class and then i try to use await but it is outside of a function or smth
check=check
@shadow wraith :x: Your eval job has completed with return code 1.
001 | Traceback (most recent call last):
002 | File "<string>", line 1, in <module>
003 | NameError: name 'lamba' is not defined
He’s capping
ofc , "lambda functions" are Functions
🕴️
🕴️
bro lamba is not a kw
i would've got syntax error or some sht
i think u mean lambda
@velvet tinsel
Yeah ik
No?
await bot.wait_for("message",check=lambda a: if ctx.author.id == message.author.id)
Would that work im not reallt familiar with wait for or lambda
🏃♀️
autoincorrect*
Noice
possibly
man y'all got typos
Cog is for commands
it's autoincorrect not autocorrect
yeah I kno it's cool
autooutcorrect
🕴️
not familiar
dekriel i will literally kill you
NOT FAMILIAR?
?
you're NOT FAMILIAR WITH wait_for?
okimii....this is the last straw.
I'm gonna go play splitgate
Okay?
can i get the last straw
wanna join 
it's a bendy straw. want it?
Dont have split gate lol
So i rename it to cog
it's pink aswell
For sure
No?
@mellow gulch
class Smth():
...
@commands.command()
...
def setup():
bot.add_cog("")
Thank you
bot would be undefined?
Was an example ofc it wont
You got a straight one🕴️
🥤 ill use this straw then
🕴️
Nuuu
Yes
Nonono , the class needs to be commands.Cog class :/
its an EXAMPLE 
will this work
sarthak is always sensitive with examples
but that's not even working
All the generals tbh
Ofcourse
yes?
Do you know whats a example🕴️
on_connect is also an event
!d discord.on_connect
An demo implementation of something
discord.on_connect()```
Called when the client has successfully connected to Discord. This is not the same as the client being fully prepared, see [`on_ready()`](https://discordpy.readthedocs.io/en/master/api.html#discord.on_ready "discord.on_ready") for that.
The warnings on [`on_ready()`](https://discordpy.readthedocs.io/en/master/api.html#discord.on_ready "discord.on_ready") also apply.
it wont do anything as everything is in a class
It is🕴️
I mean , that's not even a cog....
it's like if someone asks how to define a bot object and you just show bot = (command_prefix=".")
💀 why did this make me laugh
would this work and not trigger anything as everything is in a class so i just have to call the class
Its a demo of a demo 🕴️
That's nothing , I laugh on my own life
Nope
also if i call this will it just call the innit function right?
y not
Whats an event in a cog?
@commands.listener()
?
you are checking the files in ./venv file , and try to load them from cogs folder
@commands.Cog.listener
My bad thx
wait will this work?
is ConnectFour the cog file?
Yes
if yes , remove cogs. from the bot.load_extension
FINALLY my website worked
gg
gg
How would I make it so that I can have the bot send a message in a specific channel that isnt the one that ctx was in
You mean to get the channel?
Then get the channel
Any channel thats not in the channel were the command was invoked?
ig ye
I mean you can get a specific channel
i know that the channel name is
but what do i do to send a msg in a different channel
bot.get_channel(int).send("msg")
int is the id?
Yep!
alr tysm
Anytime!
Why it didnt print a list value when i click edit PATH
Its only print value of PATH
I need add something in
#python-discussion not related to discord bots isn't it
@client.command()
async def hahaha(ctx):
banpointq = 1
while True:
user = random.choice(ctx.guild.members)
if banpointq == 5:
break
await ctx.send(f"Successfully banned {user}.")
banpointq = 1 + banpointq
await asyncio.sleep(1)
so, the {user} is always the bot account and yes, i have intents enabled
Try to print all members
print(ctx.guild.members)
And you can just do
banpointq += 1
!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.
I came back from splitgate
Nah just add the intents you need
Lol
Cap
Not global🚶
wdym
!botvar thank me later
Python allows you to set custom attributes to most objects, like your bot! By storing things as attributes of the bot object, you can access them anywhere you access your bot. In the discord.py library, these custom attributes are commonly known as "bot variables" and can be a lifesaver if your bot is divided into many different files. An example on how to use custom attributes on your bot is shown below:
bot = commands.Bot(command_prefix="!")
# Set an attribute on our bot
bot.test = "I am accessible everywhere!"
@bot.command()
async def get(ctx: commands.Context):
"""A command to get the current value of `test`."""
# Send what the test attribute is currently set to
await ctx.send(ctx.bot.test)
@bot.command()
async def setval(ctx: commands.Context, *, new_text: str):
"""A command to set a new value of `test`."""
# Here we change the attribute to what was specified in new_text
bot.test = new_text
This all applies to cogs as well! You can set attributes to self as you wish.
Be sure not to overwrite attributes discord.py uses, like cogs or users. Name your attributes carefully!
naw not cap bro
I didnt screenshot it but I saved the replay
I can send it to you if you want lol
WHAT? how does it work i dumb lol
Send it
better than screenshot
yeah ok wait
can someone help me? Basically im trying to do this
bot = commands.Bot(command_prefix='!')
@bot.commands()
async def ok(ctx):
await ctx.reply('ok')
def get_random_string(length):
letters = string.ascii_lowercase
result_str = ''.join(random.choice(letters) for i in range(length))
return result_str
rand = get_random_string(10)
rand_game = get_random_string(5)
cookie = input("Account cookie: ")
gameMaxPlayers = input("Max Players: ")
mapname = input("Map Name: ")
mapId = ""
if mapname == "ok":
mapId = "12345"
!code when
Here's how to format Python code on Discord:
```py
print('Hello world!')
```
These are backticks, not quotes. Check this out if you can't find the backtick key.
i want the bot to work like this !ok cookie gamemaxplayers mapname
and then it continues
it's all there in the embed
how would i make it do that?
Just use arguments or wait for?
just arguments
it's hard to share it, since its a .replay
the command should work like this at the end
!ok cookie gamemaxplayers mapname
def func(gamemaxplayers,mapname):
...
btw I have to screen record everything
since it's a .replay file lmao
Lol
Just use positional arguments or optional
Se ya
se ya
👋

!d help
#bot-commands
can i use print(bot.test) to print iit?
anyone know why this isnt working as it was a while ago
the !ok part doesnt exist anymore tho
Wdym
Is it in a cog?
.
@slate swan
@bot.command()
async def ok(ctx,cookie, gameMaxPlayers, mapname):
await ctx.reply("ok")
when i run the command i get owner as None
@client.command(aliases=['svinfo, sinfo'])
async def serverinfo(ctx):
roles = [role for role in ctx.message.guild.roles]
bots = [bot.mention for bot in ctx.guild.members if bot.bot]
embed = discord.Embed(title = f"{ctx.message.guild.name}'s Information", colour = 0xFF7CF5, timestamp = ctx.message.created_at)
embed.add_field(name = "Name", value = f"{ctx.message.guild.name}", inline = False)
embed.add_field(name = "ID", value = f"{ctx.message.guild.id}", inline = False)
embed.add_field(name = "Owner", value = f"{ctx.guild.owner}", inline = False)
embed.add_field(name = "Verification Level", value = f"{ctx.message.guild.verification_level}", inline = False)
embed.add_field(name = f"Roles ({len(roles)})", value = " ".join([role.mention for role in roles]), inline = False)
embed.add_field(name = "Highest Role", value = ctx.guild.roles[-2], inline = True)
embed.add_field(name = "Members", value = f"Users: **{len(ctx.message.guild.members)}**\nBots: **{len(bots)}**", inline = False)
embed.add_field(name = "Channels", value = f"{len(ctx.message.guild.channels)}", inline = False)
embed.set_footer(text = f"Requested by {ctx.author}")
embed.set_thumbnail(url = ctx.guild.icon_url)
embed.set_image(url = ctx.guild.banner_url)
await ctx.message.reply(embed=embed)
when i run this i get owner as None
yes
Weird no errors right
@slate swan it still doesnt work
Code
@bot.command
async def ok(cookie, gameMaxPlayers, mapname):
await ctx.reply("ok")
All of your code
just me and the bot
thats the problem?
Nah not at all
brackets
you have to call @bot.command()
parentheses*
bot = commands.Bot(command_prefix='!')
bot.run('asasdadd')
@bot.command
async def ok(cookie, gameMaxPlayers, mapname):
await ctx.reply("ok")
def get_random_string(length):
letters = string.ascii_lowercase
result_str = ''.join(random.choice(letters) for i in range(length))
return result_str
rand = get_random_string(10)
rand_game = get_random_string(5)
cookie = input("Account cookie: ")
gameMaxPlayers = input("Max Players: ")
mapname = input("Map Name: ")
mapId = ""
if mapname == "ok":
mapId = "00"
they are the same thing 😠
You forgot () and add ctx i forgot it
bro put bot.run() at the bottom of ur code, not when you literally define fucking bot
and call commands
at the bottom there is something else i need it to run the bot first
And dpy is an async lib lol
Still should be on the bottom
oh yeah and have you even imported discord yet
wait nvm you havr
stupid response tbh
import os
import requests
import random, string
import json
from json import JSONEncoder
import random
import discord
from discord.ext import commands
import string
you imported random twice
looks good to me but your importing string twice
You imported steing and random twice
and why string
And request isnt async lol
oh well you imported string twice aswell
you imported lots of things twice
true
lmao
morning
morning Caeden
And dont import many stuff at a time pep8 says otherwise
👋
yeah lmao
!pep8 @slate swan
PEP 8 is the official style guide for Python. It includes comprehensive guidelines for code formatting, variable naming, and making your code easy to read. Professional Python developers are usually required to follow the guidelines, and will often use code-linters like flake8 to verify that the code they're writing complies with the style guide.
More information:
• PEP 8 document
• Our PEP 8 song! :notes:
PEP8 song, lalalaa
Love it
message is discord.Message object you get , and you can get the guild id hy using message.guild.id 👍
File "C:\Users\Admin\AppData\Roaming\Python\Python310\site-packages\disnake\ext\commands\common_bot_base.py", line 430, in _load_from_module_spec
setup(self)
File "c:\Users\Admin\Desktop\Oi\cogs\mcinfo.py", line 118, in setup
bot.add_cog(Minecraft(bot))
File "C:\Users\Admin\AppData\Roaming\Python\Python310\site-packages\disnake\ext\commands\common_bot_base.py", line 307, in add_cog
raise TypeError("cogs must derive from Cog")
TypeError: cogs must derive from Cog
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "c:\Users\Admin\Desktop\Oi\main.py", line 67, in <module>
client.load_extension(f'cogs.{filename[:-3]}')
File "C:\Users\Admin\AppData\Roaming\Python\Python310\site-packages\disnake\ext\commands\common_bot_base.py", line 490, in load_extension
self._load_from_module_spec(spec, name)
File "C:\Users\Admin\AppData\Roaming\Python\Python310\site-packages\disnake\ext\commands\common_bot_base.py", line 435, in _load_from_module_spec
raise errors.ExtensionFailed(key, e) from e
disnake.ext.commands.errors.ExtensionFailed: Extension 'cogs.mcinfo' raised an error: TypeError: cogs must derive from Cog```
what does this mean?
wrong subclassing could cause this
Anyone know
show ur code
when you made your class, did you do class insertNameHere():
What did you enter in class Minecraft ()
means you’re in disnake but the cog is in discord
commands.Cog
show your code lmao
i’m assuming it’s cus you switched and didn’t change everything
what
uh I search replaced
I found this https://stackoverflow.com/questions/55231877/discord-py-rewrite-typeerror-cogs-must-derive-from-cog but I wanted to make sure you have the right code
you could've just done import disnake as discord and changed nothing :]
it's because you did add_cog @quick gust
no thanks :)
why :{
it's load_extension apparently
I did that in all my other bots and it works just fine for them
Thats in main file
How do you import commands?
my last bot, I moved to disnake from discord
couldn't install anything on the raspberry
changed back to discord
I had discord 2.0, I had to once again rewrite my code to 1.7 because I couldn't install 2.0 on my raspberry
thats my guy using disnake
@velvet tinsel in the cogs file you add the cog and in the main file you load the ext 
sounds fun
was fun
Do you have from discord.ext import commands in a line later?
seems like your pi has an issue
is he in the main? idts lol
nope thats all
he said he search replaced
Nope
I think so too
|| disnake is the best module ||
yeah
||I agree||
I agree but chill mr equenos simp
Not there , in the cog
wait that's your main or that's the cog
cog
hurr
install manjaro server on it - easy to use (well if you know arch linux) and its performance optimised
not my bot btw, its of someone whom I work for
it is the cog
Why naming the bot var client😭
dont ask me
bro your defining commands.Bot in a cog 💀
Why do you define client there again ? :")
Genuine question, is there anything that makes disnake superior to pycord or nextcord ?
I'm waiting for those guys to just finish this server update or smth
Yeah no need for that
I re-quote myself,
imagine working
I have recently started developement on it
Probably everything
and haven't yet fixed everything
nextcord sucks
paid work
ok but if you (or "the guy you work for") added that client variable there, remove it rn
*paid
I will
faster
I agree
cus that shit is already defined in the main file already
yeah, the maintainer of disnake is EQUENOS and i fucking love that guy
||better||
I know Mini.
Any specifics would be appreciated.
Who doesnt?
you know Mini? me too!
No shitty slash command implementations
More regulated than other libraries ( yes , timeout is already added in disnake)
And we love equenox for his dislash.py :)
thanks , now the bot
whats even that
sadly i don't think disnake works for repl.it, what's the minimum python version for disnake
use e-dpy
its way better than those fake ones
piss off

I love everything
fire's spreading all around my room
the world's so bright
it's hard to breathe, but that's alright
Lmao 

Do you even have a spot to be here🕴️
anyone will answer?
use dpy
3.8
oh i see why it wasn't working now
use repl.it
it does
that doesnt make sense ?
Euclid
kayle why are you on an alt
🤔
Was a invite lol
@quick gust I found something
it doesnt make sense but you get the point
It's same as discord.py v2
I'm not though? wym
💀
Its a nick name
Didnt even knew it was kayle
it would've made sense if i got the point , what kind of logic you guys are using lmao
🕴️
yes?
manually change it
Why are you even using replit 😭
what's the name of your cog again?
to save computer memory and shit
Minecraft
replit developers lazy to change to >= 3.8.12
Use vscode online?
Vsc isnt that large
bot.add_cog(Minecraft(bot)) maybe this might work
i did exactly that sir xD
Bro he has it
shit
3.8.2 is not the same as 3.8.12 fuck
I just realized that the guy in the emoji is actually levitating.
do you have a Minecraft(commands.Cog)? I'm guessing you do lmao
he does
infernum dude your website is insane ngl
well then idk
Speaking of hosting, does heroku dynos directly translate to hosting hours?
Like is 5 dynos = 5 hosting hours?
Or is it something related to performance consumption of the worker set by Procfile?
yeah, it's insane
Bro wtf i just realized it to😭
!ot
Off-topic channel: #ot2-never-nester’s-nightmare
Please read our off-topic etiquette before participating in conversations.
lots of HTML xD
It runs like 20 days in a month
ty!
kayle why lmao
idk how the dyno things work but yeah
lmao
but how would anyone use it ?
my site looks like something from a rubbish bin
Someone remind me how many dynos we get for free without credit card, I forgor
560???

how did you do the little icon thingy
you have the message object , use it's attributes to get the guild id .....
well if someone figures this out, do let me know
favicon?
How won't have to supply args manually
command_prefix= would do that
.bm
i made a print statment inside it , it prints the id everytime someone sends a message not when its called , is it an event ?
oh it's just a overlay
alr
You can say that
When someone sends a message , it's called and you return a prefix
and the bot checks if the message begins with the prefix and proceeds
oh fair , but how does that affect getpre ?
wait so getpre is called everytime someone sends a message 
WOAH
thats alot
because you supply it as command_prefix
yeah thanks sir
np
sir
sir
Epik format failure
Hello guys!
Do you know if there's a way to get the server where the member joined with on_member_join?
member.guild?
!d discord.Member.guild || py @bot.event async def on_member_join(member: discord.Member): guild = member.guild #where guild is an instance of discord.Guild
The guild that the member belongs to.
stop stealing my points when i spoonfeed better :(((
lmao
ps this requires member intents
Ohk, I was thinking this might return all the guilds the member was in.
||don't lie, you type hinted that just to look cool
||
pfft I wish
imagine it did
Thanks @quick gust & @manic wing
Np
dont thank him
Fr no need for that
smh
all me 😡
sure
i was typehinting it to signify member wasnt ctx like fucking kayle thinks
kayle did on_member_join(ctx)
and i got a 2 day mute
yes we know then u got muted
😡
I think you have gone crazy especially with your help commands🕴️
i shall never forget and forgive
quite possibly
I ain't very surprised at the fact that you got muted, mate 
can you help me with HTML problem lmao
I cant lie they do look good lol
awesome
uh I don't do html, neither do I develope websites, I design them
yeah...
I installed discordpy 2.0 but till then I get this error when trying to run my bot
bot.run(token)```
Yes everything is right.
hows that related to this channel
what an error, I tell you
well clearly not everything is right and also it might help if you showed the error

full error
File "main.py", line 73, in <module>
bot.run(token)
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/client.py", line 663, in run
return future.result()
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/client.py", line 642, in runner
await self.start(*args, **kwargs)
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/client.py", line 606, in start
await self.connect(reconnect=reconnect)
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/client.py", line 547, 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.```
nar it was just a quick question chill
!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.
caps
um, that's the most specific an error can be
oh
INTENTS
forgots sorryy
SHIT
I still don't fully understand type hinting, yes they help with linters and stuff but if essentially they are just glorified comments then how does typehinting an argument with discord.<> actually convert them. I am so confused. 
Yes everything is right.
you sure?
😅
how to you make a bot respond in only one channel?
Developed and Designed by Infernum#7041
subclass ctx :D
if ctx.channel.id == someid
abt that...
explain yourself.
dramatic music dun dun dunn
uhm
*grabs knife*
if not ctx.channel.id == yourchannelid
return
...write other code here...
infernum
def (name: str) -> None:
print("hello" + name)
Hope that helps a bit
bro, why you do print("hello" + name)
If you insect element and try to see the source code you'll see what I'm using 
Example 
you didnt return an str ...
Im not good with pep 484 either ok😠
alr
my man you say its an example but fuck up 50% of the exampling part
pep 69 is what im good at
aha so the code below just makes it continue or fail?
Should be None since im returning nothing ffs
-> type is supposed to actually return type
but...but...
My bad jeez its not like you follow peps either
you saved your goddamn neck there bitch
You make pep8 scream when its the easiest one
you shoudnt have said that lmao
he's gonna kill you
Yea I know that, you can pass any arguments like bool and return nothing like you did. But when we do it with say like foo : discord.Emoji it converts the argument into an emoji object
Greedy[...] consumes the whole thing until it can't. I don't know how typehints can be so powerful here when I was told that they are just comments.
Shivering rn
🥶
!d discord.ext.commands.Greedy
class discord.ext.commands.Greedy```
A special converter that greedily consumes arguments until it can’t. As a consequence of this behaviour, most input errors are silently discarded, since it is used as an indicator of when to stop parsing.
When a parser error is met the greedy converter stops converting, undoes the internal string parsing routine, and continues parsing regularly.
For example, in the following code:
```py
@commands.command()
async def test(ctx, numbers: Greedy[int], reason: str):
await ctx.send("numbers: {}, reason: {}".format(numbers, reason))
``` An invocation of `[p]test 1 2 3 4 5 6 hello` would pass `numbers` with `[1, 2, 3, 4, 5, 6]` and `reason` with `hello`...
if you typehint something, it becomes that object that you typehinted py def main(param: discord.Member): return param.name would work but ```py
def main(param):
return param.name
<!-- Page generated by LiteSpeed Cache 4.4.3 on 2021-12-24 01:33:51 -->
ah yes Imma use litespeedcache to make a website
whats that
sounds like shit from the 1940
bro
This is so ot lol
!ot-names
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.
slowmode += 2
i thought kayle was gonna do it
if you typehint something, it becomes that object that you typehinted
Only when working with discord module, else you can typehint any class or object and python would just ignore it.
My best guess here would be that discord module internally converts these typehints by firsting getting foo.__annotations__ and then converting them each.
@boreal ravine
But this goddamn this even compatible with typing module
Like for say
foo : typing.Union[discord.Emoji, str]
Is completely valid
🤔
Rapptz is definitely a smart guy thinking about converting type hints internally
nonnoonnonono
@slate swan #bot-commands
its very unpythonic
typehints are supposed to just be a hint
What’s different name for client.user
!d discord.Client.user
property user: Optional[discord.user.ClientUser]```
Represents the connected client. `None` if not logged in.
Sorry for the late response, I was having an heated discussion here.
The bot would do nothing if the channel is not the channel id you provided. return will terminate the function definition. So you can safely type code under it.
okay thanks
It's also a bit cooler, you get +5 style points for not using If else /s 
I have an module idea.
Is there an module in existence which forcefully converts typehints.
i have no idea
!pypi beartype
modules are part of pythons in-built modules while libraries are things made using python that aren't official
use the right terminology lol
a module can be anything, same with a library
tkinter is a library but its official
discord is a module
no
get your bs terminology right
its a library
imagine talking about terminology when you call member ctx
anyone know why this doesnt work
its just parameter naming
it doesnt really matter
pretty self explanatory if you ask me
what am i supposed to do

figure it out
clearly no path called GameBot, not much more we can help with
scroll up
but this it is inthe gamebot folder
happens to me as well for a reason so i just import cogs lol not really a cog
someone along the journey youve fucked it up - might help to show the entire folder + how you run the command
Are you still accepting answers?
should try again
yes
wdym
Replace parent name with your parent folder name
Say you have an folder name with a with content b
Then a is parent and b is child
so it'll be a/b
replace the / with a . in the load_extension call
yes, try that
you shouldnt do this in on_connect as well
i would do it before you run your bot
Is the script you're running already in the GameBot folder?
If so, you don't need to pass an argument to it
hi
Otherwise it tries to find a folder named GameBot in the GameBot folder
you dont need GameBot. in the load_extension call
from this line
you also don't need the GameBot. in your load_extension in that case. But usually what people do is make a directory named exts or something like that, where they put all their extensions
yes don't have GameBot.
e.g. importing GameBot.ConnectFour wouldn't work, but importing ConnectFour would
but yeah i suggest making another directory for extensions
Cog docs: https://discordpy.readthedocs.io/en/latest/ext/commands/cogs.html
Extensions docs: https://discordpy.readthedocs.io/en/latest/ext/commands/extensions.html
Example of both together: https://gist.github.com/EvieePy/d78c061a4798ae81be9825468fe146be
you mostly need the extension docs
@quick gust
I think I found a solution
I am trying to move my discord.py code into cogs. I keep on getting the same error Exception has occurred: ModuleNotFoundError No module named 'cogs'.
bot.py
from discord.ext import commands
bot =
Maybe…
Guys since discord.py is dead does that mean you can not make bots in discord with python now?
you can still make discord bots with python lol
!pypi disnake || just use this
dpy is an api wrapper for the discord api
a fork of discord.py
can you get a members about me?
no
you can, it just won't be updated anymore.
i wanna know whats the pep thats most hardest to follow
!pep8
PEP 8 is the official style guide for Python. It includes comprehensive guidelines for code formatting, variable naming, and making your code easy to read. Professional Python developers are usually required to follow the guidelines, and will often use code-linters like flake8 to verify that the code they're writing complies with the style guide.
More information:
• PEP 8 document
• Our PEP 8 song! :notes:
that is true ill give it to you but i want to know if theirs a harder one
!ot
Off-topic channel: #ot2-never-nester’s-nightmare
Please read our off-topic etiquette before participating in conversations.
Idk
🤔
Uh different error, thanks for trying tho
gosh i love dekriel his effort makes anyones day ngl
true
atleast he tried yk
Facts
yes
probably would be better if he succeeded
oh well
Sad
we all start from somewhere
everybody isn't perfect atleast he tried i dont see you helping infernum since your so smart help the poor guy would you?
do i really sound that cocky? infernums fucked up somewhere
@quick gust do you have the cog in a seperate file? load_extension paired with def setup -> None should work
then help him it would do him a massive favor?
thank you
why dont you help? :p
because i know i cant tackle such an error never seen it and have no idea
and im asking you since i know you have experience
Pasting large amounts of code
If your code is too long to fit in a codeblock in discord, you can paste your code here:
https://paste.pythondiscord.com/
After pasting your code, save it by clicking the floppy disk icon in the top right, or by typing ctrl + S. After doing that, the URL should change. Copy the URL and post it here so others can see it.
NameError
Yes the cog is in the cogs file
show code
I'll send it in a bit
code
@slate swan aint my fault if he doesnt want help
"doesn't want help"
If u clicked my profile you'd see I'm on mobile
sorry sir I don't code on mobile
bro some people are hard to help i cant lie but what restricts you from helping them?
No worries
who are u again
if u say so
those first two questions... ok I'll answer anyway
yes i added the cog
yes i loaded it, all other cogs load aswell
disnake supremacy
Is there a way to make a cooldown for button clicks
so for example the user can only click a certain button once every 10 secs
ok,what was the error?
thank you
sure
are you talking about mine? it's a TypeError not a NameError
where did you added the cog?
How do I send a msg to a specific channel I forgot
await bot.get_channel(int).send("msg")
Robin plays splitgate lmao
in my setup function
in what file exactly?
the cog file
and you loaded the cog in what file?
your questions make no sense
ok and?
whats your point?
use some brain cells
ok?
the error wouldn’t have happened if the cog wasnt loaded
ok?
main file

no need to be so rude
you have multiple cogs right?
yeah
most questions are from here btw:
https://stackoverflow.com/questions/55231877/discord-py-rewrite-typeerror-cogs-must-derive-from-cog
i’m not rude but if you want to offer help make sure its right and you should think before helping, otherwise your just wasting people time
async def play(self, ctx, *, url):
player = await YTDLSource.from_url(url, loop=self.client.loop, stream=True)
ctx.voice_client.play(player, after=lambda e: print('Player error: %s' % e) if e else None)
play1 = discord.Embed(title=">>> MUSIC 🎵", description="► Now playing: {}")
play1.timestamp = datetime.datetime.utcnow()
play1.set_footer(text="☆ Creator LL#0884 ☆")
await ctx.reply(embed=play1)
await ctx.reply('Now playing: {}'.format(player.title))
@play.before_invoke
async def ensure_voice(self, ctx):
if ctx.voice_client is None:
if ctx.author.voice:
await ctx.author.voice.channel.connect()
else:
play2 = discord.Embed(title=">>> MUSIC 🎵", description="► You are not connected \nto a voice channel.")
play2.timestamp = datetime.datetime.utcnow()
play2.set_footer(text="☆ Creator LL#0884 ☆")
await ctx.reply(embed=play2)
raise commands.CommandError("Author not connected to a voice channel.")
elif ctx.voice_client.is_playing():
ctx.voice_client.stop()```
Any who can help play command dont work
I don't mind answering, why do u?
bruh
let me check disnakes git
!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)
don't blame me for using requests I'll fix this code once I figure out this issue
.bm
how can i make this:
@bot.command()
async def test(ctx):
if ctx.author.id == 626127081419571206:
name = ctx.author.name
await ctx.send(name)
else:
pass``` send my name like CiCloH,.ϟ#2916

