#discord-bots
1 messages · Page 920 of 1
Do I need to change command prefix
No
It will only be /
You won’t Change command prefix
O ok
https://gist.github.com/Rapptz/c4324f17a80c94776832430007ad40e6 has examples of a lot of new stuff including slash commands
The guild id?
ye
Wait how does the inside of your json look
{
"947688133200338985": {
"ID": "637774954695229461999123123"
}
}```
Shouldn't it be
Wdym
but that wont do it for the guild id?
^
Would it be able to see the guild id if you do [str(ctx.guild.id)]
in the .update?
Yeah
so pilot[str(ctx.guild.id)].update(dict)
well it worked with the other, but it over writ the other one
Wouldn't that just add the guild id
Instead of changing it
no?
Alright
I did this
It worked?
#discord-bots message
But it over writed the other one
Okay
yea no it keeps over Writing the other one
As i thought
yes
Can't you just update the guild id with the new one with the old id
Man this sucks ass
Just learn a database please
I will, I know how to i just prefer json
ok ty tho
Use mongodb
It's better than this and it's like json
ok
sorry to respond to this so late but what is the value of disnake? And how can I add a image to it?
what
disnake is a module?
!e
print(__import__("os"))
@slate swan :white_check_mark: Your eval job has completed with return code 0.
<module 'os' from '/usr/local/lib/python3.10/os.py'>
iirc you can't add images to statuses
Does anyone know how to make a discord bot run a python script?
Sure, just call the function. Or await it if it's a coro. If it's going to be long running make sure it's a coro as opposed to a regular function so you don't block
Thanks
does anyone know how to add details for the game activity in discord bot like this?
Not in a Discord bot afaik
discord bot's don't support rich presence
wait so how do I do it?
You can have a simple "playing X" or something like that but not rich presence
You don't
do you guys know any library that would enable me to do that?
This is an API limitation
oh right
No library you use will let you do that
sorry
import os
import discord
from discord.ext import commands
from dotenv import load_dotenv
import asyncio
import random
from keep_alive import keep_alive
bot = commands.Bot(command_prefix='!')
client = commands.Bot(command_prefix='!')
#ENV
load_dotenv()
TOKEN = os.getenv('DISCORD_TOKEN')
#Character
async def send_dm(ctx,member:discord.Member,*,content):
await member.send(content)
#Output Functions
keep_alive()
bot.run(TOKEN)
After this I get the error:
"Ignoring exception in command None:"
"discord.ext.commands.errors.CommandNotFound: Command "send_dm" is not found"
Not sure what's going on as I'm new to python
you forgot the command deco and why do you have 2 instances Bot?
lol
oop

what is your understanding of basic python
🗿
Who wants to collect 5M
bank robbery?
No
go collect some women
It’s being encouraged by us government
of what
what is this scam lmfao
Me 🙋
sure
🗿

I'm waiting for my 5m.....
gib this 5m
I just saw a thing that us will pay 5M if the public civilians can track down the corrupt money they gave Russia and its largest holders with enough information to prosecute and where the money went… 5M reward
Trying to find the post but seems easy enough with all the shit they’re finding right now and taking over
!ot
Off-topic channel: #ot2-never-nester’s-nightmare
Please read our off-topic etiquette before participating in conversations.
its a bot 🗿
so i have a ping command, and a very basic about/server command
what shall i add next? something super easy
Hey guys I wanna add a function to my bot but dont want to make it as a command just a normal function and call it and yea it still consists bot object
Example:
def function_name():
channel = bot.get_channel(123)
channel.send("Test")
function_name()
How can I do that?
emoji info?
example?
that should work normally. just make it async and await channel.send
would that be easier than say a command that sends a random cat image 🐱
hm
from an API
random cat is easier 
oh mah gawd its minaberry
Umm let me try to make it async wait
user info or avatar command
If you're up for something challenging make a wallpaper command. 3 buttons are added to the message and let's you cycle back and forth through images
something super easy
🗿
has to be a coroutine
async def hello():
channel = await bot.get_channel(123)
print(channel)
Ok so I defined this one but still I have to call it after bot.run(token) so how to do that?
!paste
Pasting large amounts of code
If your code is too long to fit in a codeblock in discord, you can paste your code here:
https://paste.pythondiscord.com/
After pasting your code, save it by clicking the floppy disk icon in the top right, or by typing ctrl + S. After doing that, the URL should change. Copy the URL and post it here so others can see it.
This was the wallpaper command I made
It's not completely polished but it does work
I quit bot dev before I completely finished it
@slate swan hey dad, are you proud of me
Aha didnt read it wait ill try
did you copy pasted all of this code
it seems like you did
@slate swan didnt get it can you pls show an example or maybe some reference
!d discord.ext.commands.Bot.get_channel
get_channel(id, /)```
Returns a channel or thread with the given ID.
Changed in version 2.0: `id` parameter is now positional-only.
@slate swan do you knowq how to make a bot run a file
it doesnt say its a coroutine so no need to await it
I actually didn't
what type of file?
Aye ill checkout that wait
wdym a main?
no like i want to run a python file
why is your annotations so off
try using the os module
in a bot?
How are they off
!d os.system
os.system(command)```
Execute the command (a string) in a subshell. This is implemented by calling the Standard C function `system()`, and has the same limitations. Changes to [`sys.stdin`](https://docs.python.org/3/library/sys.html#sys.stdin "sys.stdin"), etc. are not reflected in the environment of the executed command. If *command* generates any output, it will be sent to the interpreter standard output stream. The C standard does not specify the meaning of the return value of the C function, so the return value of the Python function is system-dependent.
On Unix, the return value is the exit status of the process encoded in the format specified for [`wait()`](https://docs.python.org/3/library/os.html#os.wait "os.wait").
ye like if i did !encrypt (text) it will print the output
your typehints
i will look into this
Yeah what's wrong with them
well you can just use print im not really sure what you want
what do you want to output anyways
no like the bot will send it in the server
i want easy 
want me to send an example 💀
I guess store it in your head until you want something challenging
what would an avatar command do?
Display the users avatar
some arguments dont have annotations
copy paste someone else's code and edit it 😎 (easier)
Preferably in an embed
lol ikr, just copy @unkempt canyon ggwp done
It was really late
is that even in discord 
sure it was
no bruh
On god I didn't copy the code
im trying to get the input from discord
Aye I got it, but like how can I fetch and then use channel.send with it?
do you permit the user to only run this on themselves?
should add a timestamp, when the user was created at, the users roles etc
@bot.command()
async def encrypt(ctx, text: str):
#do stuff
like this?
no
No, they can run it on anyone
most bots let you mention a users if the argument isnt given the author is the value that gets set
slate2 slash commands look good for some reason
and no need to mention the user at all since Member class accepts mentions or ids since on a mention you can parse the id out of the mention since the format is @pastel pike
yea
get text encrypt text
this looks so smooth ngl
yes
Umm is channel.send() await function too? Bcs when am defining that am facing issues
.send yes its a coroutine
!d discord.TextChannel.send
await send(content=None, *, tts=False, embed=None, embeds=None, file=None, files=None, stickers=None, delete_after=None, nonce=None, allowed_mentions=None, reference=None, ...)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).
Sends a message to the destination with the content given.
The content must be a type that can convert to a string through `str(content)`. If the content is set to `None` (the default), then the `embed` parameter must be provided.
To upload a single file, the `file` parameter should be used with a single [`File`](https://discordpy.readthedocs.io/en/master/api.html#discord.File "discord.File") object. To upload multiple files, the `files` parameter should be used with a [`list`](https://docs.python.org/3/library/stdtypes.html#list "(in Python v3.10)") of [`File`](https://discordpy.readthedocs.io/en/master/api.html#discord.File "discord.File") objects. **Specifying both parameters will lead to an exception**.
To upload a single embed, the `embed` parameter should be used with a single [`Embed`](https://discordpy.readthedocs.io/en/master/api.html#discord.Embed "discord.Embed") object. To upload multiple embeds, the `embeds` parameter should be used with a [`list`](https://docs.python.org/3/library/stdtypes.html#list "(in Python v3.10)") of [`Embed`](https://discordpy.readthedocs.io/en/master/api.html#discord.Embed "discord.Embed") objects. **Specifying both parameters will lead to an exception**.
So how should I handle it within a function as the function is not a command....
just do it normally
I love how discord decided to show it with that bot's pfp 🗿
async def hello():
channel = bot.get_channel(123)
await channel.send("Hey")
I have something like this but it aint working
Describe not working
what's not working 🧍
Aye wait
shows this RuntimeWarning: Enable tracemalloc to get the object allocation tracebac
you need to await it
Umm channel.send() ?
which line
By the way, it is possible for any user/bot to get the avatar or banner of any other user given an id
RuntimeWarning: coroutine 'hello' was never awaited
self.function(*self.args, **self.kwargs)
RuntimeWarning: Enable tracemalloc to get the object allocation traceback
read it again
Regardless of whether the target user is in the server
well it says it lol
Yes, my message is not related to what you said
You can use the API to fetch a User, doesn’t have to be in a guild with the bot etc
It would be a cool feature
the error is the problem
and in the error is the solution
yeah
i've seen it on other bots
just always thought it was weird bc it would let people find the original full size image of user's pfps. i know it's available, but it just made it too easy for my personal liking
well this is discord
read this @inner epoch
https://docs.python.org/3/library/asyncio-task.html#coroutines
I see
Yea I was going through that wait ill check
btw, i'm looking for the documentation of how to return the discord time stamps
but i suppose i just return the string <:whatever:> and discord does the rest
If your on v2.0+ there’s a utility method for it with discord.py
!d discord.utils.format_dt
discord.utils.format_dt(dt, /, style=None)```
A helper function to format a [`datetime.datetime`](https://docs.python.org/3/library/datetime.html#datetime.datetime "(in Python v3.10)") for presentation within Discord.
This allows for a locale-independent way of presenting data using Discord specific Markdown...
But yea you can return a string yourself as well, then the client will render it
you can see the formats here in the ddocs https://discord.com/developers/docs/reference#message-formatting-timestamp-styles
Integrate your service with Discord — whether it's a bot or a game or whatever your wildest imagination can come up with.
?
Crazy, is that new? Didn't know that was possible
That’s fire
new thing in the api update iirc
not yet released publicly 
question how do you make the arg not required like this?
async def command(self,ctx,arg = None):
...more code ```
That’s the way
bro
🗿
Setting a default makes it optional
Cool, can't wait
he answered himself 💀
Not to be condescending, but
async def command(self,ctx,arg = None):
...more code
is how to make it optional
You already had it 😄

🗿
lol better to be safe then sorry lol
@worldly baneMind if I pm?
yeah
umm ok no worries...
I mean i don't mind
Lol😅
then you say no 
so
default_avatar, this is the default avatar discord gives you if you don't upload anything
guild_avatar, this is the avatar if they have nitro and have set a specific pfp for the guild
display_avatar, this is the same as above, otherwise it's their global
is that right? if a user has a guild_avatar then their global pfp is not available thru the API?
display_avatar is their global the guild_avatar is the specific one which if they dont have a guild one it returns None
Well, they have a list of about 5 default avatars (discord icon with a different background color) so yeah it calculates which one you have based on your discrim
!d discord.Member.guild_avatar
property guild_avatar```
Returns an [`Asset`](https://discordpy.readthedocs.io/en/master/api.html#discord.Asset "discord.Asset") for the guild avatar the member has. If unavailable, `None` is returned.
New in version 2.0.
yup its an optional asset
in my testing both gulid_avatar and display_avatar are both showing my guild-specific pfp only
reading the docs that sounds right
Discord's API guild member object avatar is optional so discord.py has to calculate what it is by itself
it doesn't sound like i'd be able to get my black/white global pfp (click my pfp)
but wait that can't be rigth
or no it is right, i think
@worldly bane @slate swan @final iron Thanks a lot guys for the help I finally figured out it and also learned something new!!
@bot.event
async def on_member_update(before, after):
if before.status != after.status:
return
if str(before.status) == "online":
if str(after.status == "offline"):
return
if str(before.status) == "offline":
if str(after.status == "online"):
return
if before.activity != after.activity:
req_act = "vanity url here"
my_server = bot.get_guild(channel id)
role_id = role id here
role = my_server.get_role(role_id)
if act := [activ.name for activ in after.activities if activ.type == ActivityType.custom and req_act in activ.name]:
channel = bot.get_channel(channel id here)
emb = discord.Embed(color=0xffffff)
emb.description = f"""
thanks for the vanity wowow
"""
emb.set_footer(text="vanity")
if role in after.roles:
return
else:
await channel.send(f"<@{after.id}>", embed=emb)
await after.add_roles(role)
else:
await after.remove_roles(role)
error:
File "main.py", line 35, in <listcomp>
if act := [activ.name for activ in after.activities if activ.type == ActivityType.custom and req_act in activ.name]:
TypeError: argument of type 'NoneType' is not iterable
help
!d discord.Member.display_avatar
property display_avatar```
Returns the member’s display avatar.
For regular members this is just their avatar, but if they have a guild specific avatar then that is returned instead.
New in version 2.0.
"but if they have a guild specific avatar then that is returned instead." yup
ah those docs are better :x
disnake doesn't make that super super clear
anytime
but its the same in disnake 😭
😀 👍
why use disnake when you can use discord.py if you are just starting lol
nvm i was looking in the wrong place lol
!d disnake.Member.display_avatar
property display_avatar```
Returns the member’s display avatar.
For regular members this is just their avatar, but if they have a guild specific avatar then that is returned instead.
New in version 2.0.

dpy main isnt even released 
i was looking under disnake.User
😭
i was test-driving disnake's setup guide thing
- im trying to make a vanity url status detector but theres this error
ah
i'm at a point where it doesn't matter which framework i use anyway
disnake isnt bad lol
!e
print([a for a in None])
is what youre trying to do
@slate swan :x: Your eval job has completed with return code 1.
001 | Traceback (most recent call last):
002 | File "<string>", line 1, in <module>
003 | TypeError: 'NoneType' object is not iterable
oh
so just to confirm, it's not possible for me to show in an embed both a user's guild-specific & global pfps
well you can use the user obj
!d disnake.User.display_avatar
property display_avatar```
Returns the user’s display avatar.
For regular users this is just their default avatar or uploaded avatar.
New in version 2.0.
can i? playing with it right now
@commands.slash_command()
async def user(self, inter: disnake.ApplicationCommandInteraction):
in this context are inter.user & inter.author different?
they seem the same to me
disnake makes inter.author the author of the interaction while some forks stick with dpy and use inter.user
samething lol
Try using the user object like okimii suggested, since users don't have guild-specific profile pictures as they're not part of a guild
yeah using user didn't change anything
show your code
!d disnake.Interaction.author
The user or member that sent the interaction.
well it probably returns the guild avatar since authors return type is a union of user and member
You need to subclass bot for overriding context right?
btw is there 1 property that encompasses this {inter.author.name}#{inter.author.discriminator}
username#discrim
there probably is and i just missed it
str(inter.author)
What's the issue?
@daring oliveprobably returns the guild avatar as the return type is a union https://github.com/DisnakeDev/disnake/blob/master/disnake/interactions/base.py#L216
disnake/interactions/base.py line 216
def user(self) -> Union[User, Member]:```
disnake/interactions/base.py line 187
self.author: Union[User, Member] = MISSING```
ic ic
not sure why theres no method that returns only the avatar of the user class
For member i assume, guild specific is member.display_avatar and global is member.avatar
!d disnake.Member.guild_avatar
property guild_avatar```
Returns an [`Asset`](https://docs.disnake.dev/en/latest/api.html#disnake.Asset "disnake.Asset") for the guild avatar the member has. If unavailable, `None` is returned.
New in version 2.0.
Or that ^
nah
Ah then i may be missing context
Im not sure if this is true but I think display_avatar will return a default pfp if the user doesn’t have one when avatar will return None
yeah but in member it would return the guild one and not the global one which thats her problem
What about avatar?
thats the default one if they dont have it, it returns None
!d discord.Member.avatar
!d discord.User.avatar
property avatar```
Returns an [`Asset`](https://discordpy.readthedocs.io/en/master/api.html#discord.Asset "discord.Asset") for the avatar the user has.
If the user does not have a traditional avatar, `None` is returned. If you want the avatar that a user has displayed, consider [`display_avatar`](https://discordpy.readthedocs.io/en/master/api.html#discord.User.display_avatar "discord.User.display_avatar").
i recommended to use user but she would need to fetch the user since interaction author returns union
member.avatar returns global no?
I think it would
or make a user obj which i forgot how
nope default
!d discord.User.display_avatar
property display_avatar```
Returns the user’s display avatar.
For regular users this is just their default avatar or uploaded avatar.
New in version 2.0.
"uploaded avatar"
i couldn't find a way
if one of you do (and confirm it works) pls let me know
which the member display returns the guild one or the global which she only wants the global
@daring olive probably need to fetch the user or convert it in a way maybe create an instance of the obj which i forgot how its done
fetching is probably your best bet
yup
is pymongo this channel or #databases
Not ideal having to make an API request but I don't think there's any other way
!d discord.ext.commands.Bot.fetch_user
await fetch_user(user_id, /)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).
Retrieves a [`User`](https://discordpy.readthedocs.io/en/master/api.html#discord.User "discord.User") based on their ID. You do not have to share any guilds with the user to get this information, however many operations do require that you do.
Note
This method is an API call. If you have [`discord.Intents.members`](https://discordpy.readthedocs.io/en/master/api.html#discord.Intents.members "discord.Intents.members") and member cache enabled, consider [`get_user()`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.Bot.get_user "discord.ext.commands.Bot.get_user") instead.
Changed in version 2.0: `user_id` parameter is now positional-only.
yeah i dont know either
database
link to loops?
which loops
for result in results idk if that is python discord.py or pymongo sadly
gave docs because i dont use pymongo but it probably has examples
well i have no idea if it is reg python discord.py or pymongo but thanks
how do i add the desktop in linux debian?
i'll take a look tmrw thanks guys
in the meantime
i succeeded at making a cat command

i think this is a win
i agree
Pick one, gnome, KDE, xfce?
gnome
From there it's pretty easy to install since it's all modular
Easiest way would be to use something like ubuntu that comes with gnome and is debian-based
motor broke my bot 
sqlite > mongo, couldnt relate
you can't compare a language to a database 
mhm
Says who 🧍

on_message?
¯\_(ツ)_/¯
you mean if you dm the bot it will just make fun of you im not really sure what you mean
Check if the author of the message is the bot
regen the token?
sounds like a you problem?
that's just a random loop, it's normal python. need more context if you want help
you shouldn't be using pymongo with discord bots though, use an async driver otherwise your bot will stall whenever it makes db requests (like motor)
when I try to insert an additional guest image, this error occurs:
I tried some tutorials from yt and some websites to solve it, but I was not successful
That happened to me as well, just install it from the repos
But this is more fit for one of the OTs
just dont compare its id
how do I do this?
🧐
Sheesh I wrote some code and it shouldn't have worked but its working!! Like how😅
show i can explain
Lol no I got how its working but I didnt expect it to work
ah nice it happens
you shouldn't use pymongo, use motor https://motor.readthedocs.io/en/stable/
Motor is an async driver for mongodb. using pymongo will mean your bot will stall whenever it makes a db request
😅 👍 Am happy lol
Why dont we have reactions in this channel?
how to send message when command not found, but also with the command the user invoked, like !testnotfound will return error command "testnotfound" not found, in SO there is a question about that, but i want the one that also send the unknown command, like command {unknown_command} is not found, sorry!
use motor
🛵
Can i use it for now?
do you have an error handler?
well, yes
is instance it
idk wym but
@bot.event
async def on_command_error(ctx, error):
if isinstance(error, CommandNotFound):
not_found = discord.Embed(title="command not found!", description="command not found! might be in progress, "
"check `sal! help` for the available "
"commands", color=ctx.author.color)
await ctx.send(embed=not_found)
raise error```
try commands.CommandNotFound?
Anyone tell me what's the error?
Although I wouldn't recommend that, it's spammy in servers that use a bunch of diff bots
What I have to do?
#databases ? if that's mongodb
||tbh idk, me not use mongo, use SQL, better xd||
umm what :V
If I use now I have to change whole code
You'll have more problems down the line if you continue to use pymongo instead of motor
(or sql)
If I use motor I have to change whole code
nvm
Sort of yes but it isn't too different. It's just an async version of pymongo
Can I use pymongo for now 😩
@bot.event
async def on_command_error(ctx, error):
if isinstance (error, discord.ext.commands.errors.CommandNotFound) is True:
#do stuff
else:
raise error
try that
I made that when I barely knew any python like 10 months ago 😔

works anyways
🗿 wher the part to send unknown command
#do stuff
bruh, i need the code to send unknown command ;-; not #do stuff
you don’t have to use is True
or i'll change the question (maybe): what decorator to shows what comand the user invoked
what are u trying to do?
so when a user invoke a command, and the command unknown (i mean not found) bot will send message "command not found" along with the command the user invoked
read the previous messages
ctx.message
I don't spoonfeed TvT
🗿 umm i use isinstance error-
just decorator ;-;
that doesn’t make sense have you seen the code sent by Hello66
you still have a command context in your hands for this event
so you can access the command message through ctx.message
^
hmm, ||kinda make sense so|| lemme try
u def didn’t study python to enough level before starting to work with dpy
wait, will it also including the prefix or just command :V
class discord.Message```
Represents a message from Discord.
x == y Checks if two messages are equal.
x != y Checks if two messages are not equal.
hash(x) Returns the message’s hash.
Idk print it to check
k, wait
Ignoring exception in on_command_error
Traceback (most recent call last):
File "C:\Python310\lib\site-packages\disnake\client.py", line 515, in _run_event
await coro(*args, **kwargs)
File "C:\Users\User\Downloads\PycharmProjects\main.py\main.py", line 440, in on_command_error
print(ctx.message)
File "C:\Python310\lib\encodings\cp1252.py", line 19, in encode
return codecs.charmap_encode(input,self.errors,encoding_table)[0]
UnicodeEncodeError: 'charmap' codec can't encode characters in position 116-117: character maps to <undefined>```
```py
@bot.event
async def on_command_error(ctx, error):
if isinstance(error, CommandNotFound):
not_found = discord.Embed(title="command not found!", description="command not found! might be in progress, "
"check `sal! help` for the available "
"commands", color=ctx.author.color)
z = []
for command in bot.commands:
print(command)
print(ctx.message)
# if similar(ctx.message, command) > 0:
# z.append(command)
not_found.add_field(title="similar commands", description=z)
await ctx.send(embed=not_found)
raise error```
Maybe print ctx.message.content?
k wait
And yeah pretty sure ctx.command exists as well
!d discord.ext.commands.Context.command
The command that is being invoked currently.
Hey @lone lotus!
You either uploaded a .txt file or entered a message that was too long. Please use our paste bin instead.
hey how can I get a message id?
Developer mode
ahh not like that
I'm making a context menu quote command py async def Quote(inter, message: disnake.Message):
Hmm
now in this I need the id for message parameter for message link
If your using disnake then i cant help sorry
currently this is how the message link looks like py msg_link = f'https://discord.com/channels/{inter.guild.id}/{inter.channel.id}/{???}'
and now I'm stuck at what to do with last one
Hm
🗿it has nothing to do with disnake
I haven't tried yet
The message ID.
@maiden fable help him
With?
This dude
Message link is always py https://discord.com/channels/server_id/channel_id/message_id
Yea
Yea
ye that's how I did
let me test with message.id
@honest shoalor help
🗿
@drowsy thunder Stop pinging randoms please
.
We ain't liable to help anyone here
how can I get the timestamp of a selected message?
!d discord.Message.created_at
property created_at```
The message’s creation time in UTC.
Sorry my discord is glitching
👋
You are not allowed to use that command here. Please use the #bot-commands channel instead.
!d discord.on_member_join
discord.on_member_join(member)``````py
discord.on_member_remove(member)```
Called when a [`Member`](https://discordpy.readthedocs.io/en/master/api.html#discord.Member "discord.Member") join or leaves a [`Guild`](https://discordpy.readthedocs.io/en/master/api.html#discord.Guild "discord.Guild").
This requires [`Intents.members`](https://discordpy.readthedocs.io/en/master/api.html#discord.Intents.members "discord.Intents.members") to be enabled.
member*
!d discord.on_member_join
discord.on_member_join(member)``````py
discord.on_member_remove(member)```
Called when a [`Member`](https://discordpy.readthedocs.io/en/master/api.html#discord.Member "discord.Member") join or leaves a [`Guild`](https://discordpy.readthedocs.io/en/master/api.html#discord.Guild "discord.Guild").
This requires [`Intents.members`](https://discordpy.readthedocs.io/en/master/api.html#discord.Intents.members "discord.Intents.members") to be enabled.
memer
😔 Stop
datetime.message.creatd_at?
No, https://discord.com/channels/@me/{channel.id}/{message.id} for DMs
Good catch, I forgot that there's no server in DM
But generally it's always 3 things to know where the message is
am I right?
just make it
!e
print(1+1)
@drowsy thunder :white_check_mark: Your eval job has completed with return code 0.
2
!d exec
How dude
use jishaku
exec(object[, globals[, locals]])```
This function supports dynamic execution of Python code. *object* must be either a string or a code object. If it is a string, the string is parsed as a suite of Python statements which is then executed (unless a syntax error occurs). [1](https://docs.python.org/3/library/functions.html#id2) If it is a code object, it is simply executed. In all cases, the code that’s executed is expected to be valid as file input (see the section [File input](https://docs.python.org/3/reference/toplevel_components.html#file-input) in the Reference Manual). Be aware that the [`nonlocal`](https://docs.python.org/3/reference/simple_stmts.html#nonlocal), [`yield`](https://docs.python.org/3/reference/simple_stmts.html#yield), and [`return`](https://docs.python.org/3/reference/simple_stmts.html#return) statements may not be used outside of function definitions even within the context of code passed to the [`exec()`](https://docs.python.org/3/library/functions.html#exec "exec") function. The return value is `None`.
AttributeError: type object 'datetime.datetime' has no attribute 'message'
I found out how to make one by checking r.danny's src code. I recommend doing that
💀
what
🗿
!d disnake.Message.created_at
property created_at```
The message’s creation time in UTC.
how can I make a timestamp from this?
#bot-commands
\🗿
You mean unix?
no, the embed timestamp
no only message.created_at
!d nextcord.Embed
class nextcord.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.10)") 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://nextcord.readthedocs.io/en/latest/api.html#nextcord.Embed.Empty "nextcord.Embed.Empty").
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.
class disnake.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.10)") 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://docs.disnake.dev/en/latest/api.html#disnake.Embed.Empty "disnake.Embed.Empty").
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.
See the last part?
pass it to the timestamp kwarg of discord.Embed
that I did
He uses disnaje
how to get messages of a member?
Use this
Wdym
like how many msg i did
I know how to set a timestamp in embeds, I was asking about the timestamp of specific message which was created in past
Getting the count or exact message text?
count
Like this?brb
@slate swan TextChannel has a .history() you can use, but you will have to loop over every TextChannel of a server
bro
Whops I replied to wrong message
.
timestamp = message.created_at?
ok.
yes this is working fine
Sorry
But it takes so long to give u results

Yo mean this? @slate swan
https://imgur.com/eM3xGp3
Unfortunately you need to do some API call for discord to return them messages to you
So unless you are storing discord messages
there's no other way, unless they log peoples messages
Ye i preferr using db🤌
I have a idea
Using a data base and a @client.listen event
I'd suggest reviewing their ToS carefully in that case, to see if they allow you to store information like that
Discord allows storing messages but for a maximum of 30 days iirc
So on_message it will add the count to the database
docs pls?
!d discord.TextChannel.history
async for ... in history(*, limit=100, before=None, after=None, around=None, oldest_first=None)```
Returns an [asynchronous iterator](https://docs.python.org/3/glossary.html#term-asynchronous-iterator "(in Python v3.10)") that enables receiving the destination’s message history.
You must have [`read_message_history`](https://discordpy.readthedocs.io/en/master/api.html#discord.Permissions.read_message_history "discord.Permissions.read_message_history") permissions to use this.
Examples
Usage...
ok
I mean you're not going to store "their msgs" but you're just going to count how many msgs they sent

If yk wut i mean
count = 0
for channel in ctx.guild.channels:
for message in channel.history():
if message.author == user:
count += 1
```didnt test yet
you need to store them before you can count them
this is also storing...
which will be wiped after every restart
yes
after every command*
Mmm
@maiden fable check ur dms
idk why my file are getting that M
your editing a github repository
m = modified
this is the only good way lol
it auto update the files?
Guys,can someone check my repl,it has a error i cant even fix
send the error
nope
ok
@slate swan yo can yo help me as the error Im getting is almost impossible to fix if you dont freaking delete the code
can i reupload from vsc
What error?
??
Check the repl.you will regonize it
can u share here
It will be bad,I will dm
!paste
Pasting large amounts of code
If your code is too long to fit in a codeblock in discord, you can paste your code here:
https://paste.pythondiscord.com/
After pasting your code, save it by clicking the floppy disk icon in the top right, or by typing ctrl + S. After doing that, the URL should change. Copy the URL and post it here so others can see it.
use paste bin
No,the code is a app-issue
I will dm the replit link,and can ya fix it
Its a minor problem but i cant fix it.
disnake.ext.commands.errors.CommandInvokeError: Command raised an exception: TypeError: 'HistoryIterator' object is not iterable
Show your code
for message in channel.history():
it's an awaitable
ok
Can I dm you replit link @slate swan
no
async for message in channel.history():
Someone help me
do ```py
async for message in channel.history():
...
AAAAAAAAAAAAAAAAA
The code doesnt have a problem but the IDE has the problem,Im askibg if you can fix it
you can solve your error if you learn how to indent properly 👁️
The only option you've given us so far is to rub a crystal ball and make a guess
honestly the IDE is replit so its normal to have billions of issues LOL
If it's on repl perhaps try joining their discord server
Wdym lol

I have
But the error is a bit like this

!indent
!indent
Indentation
Indentation is leading whitespace (spaces and tabs) at the beginning of a line of code. In the case of Python, they are used to determine the grouping of statements.
Spaces should be preferred over tabs. To be clear, this is in reference to the character itself, not the keys on a keyboard. Your editor/IDE should be configured to insert spaces when the TAB key is pressed. The amount of spaces should be a multiple of 4, except optionally in the case of continuation lines.
Example
def foo():
bar = 'baz' # indented one level
if bar == 'baz':
print('ham') # indented two levels
return bar # indented one level
The first line is not indented. The next two lines are indented to be inside of the function definition. They will only run when the function is called. The fourth line is indented to be inside the if statement, and will only run if the if statement evaluates to True. The fifth and last line is like the 2nd and 3rd and will always run when the function is called. It effectively closes the if statement above as no more lines can be inside the if statement below that line.
Indentation is used after:
1. Compound statements (eg. if, while, for, try, with, def, class, and their counterparts)
2. Continuation lines
More Info
1. Indentation style guide
2. Tabs or Spaces?
3. Official docs on indentation
for channel in ctx.guild.channels:
disnake.ext.commands.errors.CommandInvokeError: Command raised an exception: AttributeError: 'CategoryChannel' object has no attribute 'history'
@maiden fable can you check it cuz I tried many times and didnt work
why don't you use vscode?
i do
Because Im on tablet and I have no pc,and till now my dad didnt buy me one,but tablet seems good for me aaaa
Make sure your iterating over a TextChannel
oh, ok.
Hmmm, so there must be no space before await?
gimme dm link]
Ok
in other words or simple words fix the spaces and tabs used
why u using replit but
im usingfor channel in ctx.guild.channels:
@bot.command()
async def fm(ctx, channel: nextcord.TextChannel=None):
channel = channel or ctx.channel
messages = await channel.history(oldest_first=True,limit=1).flatten()
await ctx.send(messages[0])```
this ^^ prints: ```py
<Message id=862529724579315733 channel=<TextChannel id=843120245908176898 name='general' position=0 nsfw=False news=False category_id=843120245908176897> type=<MessageType.default: 0> author=<User id=806458860662816825 name='Shadow' discriminator='9430' bot=False> flags=<MessageFlags value=0>>```
now how do i get the message id from this
i am unable to iterate thro the printed msg cuz 'message object isnt iterable
code please
Use the id property on the message object you just got
Use ctx.guild.text_channels instead
oo tyty

giveaway_options = [
discord.Option(str, name = "giveaway_type", required = True, description = "Choose a giveaway type.",
choices = [
discord.OptionChoice(name = "Button"),
discord.OptionChoice(name = "Reaction")
]),
discord.Option(discord.TextChannel, name = "channel", default = None, description = "Choose a channel."),
discord.Option(discord.Member, name = "hosted_by", default = None, description = "Choose a member."),
discord.Option(int, name = "winners", default = 1, description = "How many winners should it be?", min_value = 1, max_value = 30),
discord.Option(discord.Role, name = "ping_role", default = None, description = "Choose a role that should get pinged.")
]
```gives an error saying ` ClientException: Too many arguments passed to the options kwarg.`
ok
What library?
and maybe read the error, it can't have that many options
How many options can it have then?
Pycord
🗿 bad
and which property wud allow me to get the user id?
author
returns the username#discrim
no3
use the id property on that
????
messages[0].author.id
oh wait yea
lmao
hu'
ty ty
why to use [0] here it works fine without it?
messages is a list
flatten returns a list
Youtube, docs
Is it possible to send
Embed inside button interaction response?
If yes please explain
I mean
The bot should send a embed
On button click
Not saying that embed inside a button or button inside embed
how can i make is so only open works
@client.command()
async def knock(ctx):
def check(message):
return message.author == ctx.author and message.channel == ctx.channel
embedk = nextcord.Embed(title="Somone is knocking on the door", description="type open to open the door")
await ctx.send(embed=embedk)
desc = await client.wait_for('message', check=check)
embed = nextcord.Embed(description=desc.content, color=0xFFFF)
await ctx.send(embed=embed)
Sure
Yea but
That would require embed in variable,
I tried doing it but upon clicking the button nothing pops
um-
I’ll just dm you something
And send the code later
ok
Not on my lap Rn
Sorry
ty
nextcord is just a bad fork tbh
thats what i did
I tried something like 3-4 forks, included nextcord and Pycord, but disnake indeed is the best fork i've ever tried
dpy best
i am working with heroku, it is giving ffmpeg not found error how can i solve this ?
nextcord pycord 👎
i added ffmpeg in path
but how i can do that with heroku ?
.
async def on_ready():
await client.change_presence(status=discord.Status.online, activity=discord.Game("TESTING"))
``` how do i make the discord.game nothing at all
If you can next time please turn off the ping
Sorry bro my bad
# Setting `Playing ` status
await bot.change_presence(activity=discord.Game(name="a game"))
# Setting `Streaming ` status
await bot.change_presence(activity=discord.Streaming(name="My Stream", url=my_twitch_url))
# Setting `Listening ` status
await bot.change_presence(activity=discord.Activity(type=discord.ActivityType.listening, name="a song"))
# Setting `Watching ` status
await bot.change_presence(activity=discord.Activity(type=discord.ActivityType.watching, name="a movie"))
Don't do it on_ready
Instead set the activity and status kwargs in the constructor of bot. py bot = commands.Bot(command_prefix="something", activity=..., status=...)
sup folks, not to barge into the current issue but I need some advice on how to do things. I have a price tracker where if several items dips below a threshold, it will send a message on discord.
currently that is hardcoded in with bot.loop.create_task(tracker(itemName, threshold)) but I want to be able to use !create tracker itemName to dynamically spin up new tasks. issue is, I'm not sure the correct implementation of this
creating the ! commands is not my issue, more so is there any best practices for spinning up new tasks to track new items/deleting specific tasks when I don't want to track the items anymore
uhm so essentially you want to delete a tracker? where those tracker are saved?
yes! more specifically I want to stop the task completely if I do not want to track the price more
async def get_logs_channel(self, guild_id):
data = await self.bot.db.fetchval("SELECT channel_id FROM modlogs WHERE guild_id=$1", guild_id)
if data:
return self.bot.get_channel(data)
async def create_webhook(self, guild_id):
channel = await self.get_logs_channel(guild_id)
return await channel.create_webhook(
name=f"{self.bot.user.name} " + "Logging",
avatar=self.bot.user.avatar.url,
reason="For logging"
)
``` 'NoneType' object has no attribute 'create_webhook'
how do i fix this? when sending to that channel, it doesnt give me this error.. but when im trying to create a webhook it shows me this error
What does this mean?
show ur json file
{}
yeah it has to be
}``` iirc
sure, try
What package do you use for the task? asyncio?
does anyone know why im getting this error?
yep asyncio
And do you want to stop it or cancel it?
are they not effectively the same thing?
I'm not sure what the difference but perhaps I want to completely stop the task
no, its simple, there's just no data for that guild in the json file
Yeah there isn't
exactly
!d asyncio.Task.cancel
cancel(msg=None)```
Request the Task to be cancelled.
This arranges for a [`CancelledError`](https://docs.python.org/3/library/asyncio-exceptions.html#asyncio.CancelledError "asyncio.CancelledError") exception to be thrown into the wrapped coroutine on the next cycle of the event loop.
The coroutine then has a chance to clean up or even deny the request by suppressing the exception with a [`try`](https://docs.python.org/3/reference/compound_stmts.html#try) … … `except CancelledError` … [`finally`](https://docs.python.org/3/reference/compound_stmts.html#finally) block. Therefore, unlike [`Future.cancel()`](https://docs.python.org/3/library/asyncio-future.html#asyncio.Future.cancel "asyncio.Future.cancel"), [`Task.cancel()`](https://docs.python.org/3/library/asyncio-task.html#asyncio.Task.cancel "asyncio.Task.cancel") does not guarantee that the Task will be cancelled, although suppressing cancellation completely is not common and is actively discouraged.
Changed in version 3.9: Added the *msg* parameter.
The following example illustrates how coroutines can intercept the cancellation request:
there needs to be data for you to return
so how to fix that uh?
you add data lol
manually or through a command
if u wanna do it for a setprefix command
also I'd suggest using databases
show me how you call create_webhook
webhook = await self.create_webhook(before.guild.id)
await webhook.send(embed=em)
@boreal ravine ^^
self is none 
its used in cogs
when i use it like self.get_logs_channel(before.guild.id) it works..
when converting to webhook, it gives me this error
Cog class has no method create_webhook .-.
get_logs_channel could be something declared somewhere
how to mention a voice channel?
just a .mention
!d discord.VoiceChannel.mention
property mention```
The string that allows you to mention the channel.
Just curious. If I am using multiple files for code. Is it better to use COGs or to just from file import file. And whatever your answer is, what's the benefit of it
Brb
If you're on phone you'll see something like #channelname
Download it
<#CHANNELID>
Ye, then uhm restart ur ide?
utc_time = calendar.timegm(date.utctimetuple())+1800
print(utc_time)```
this is my code
i want it to print 1800 more seconds from current time
Uh okay
Idk

Well my code is on heroku so it should work
Oh
somebody help
Doesn't have anything to do with my ide
Then add "nextcord" to ur requierements.txt file
aahhhh
oh god i cant spell
yeah thats prob it
Why are you saying this in the discord bot channel
ty bro
Yw
!d discord.ext.commands.Command.aliases
The list of aliases the command can be invoked under.
I saw with nextcord you always need like a testserverid for slash commands, do you really need that? Aren't you able to just get slashcommands without that
Eh wut u trying to do?
so I dug into it for a little while and had almost got what I wanted(cheers). I renamed my task to SPAM for clarity and was able to list out all my tasks with currentTasks = asyncio.all_tasks() then printing that out. now I'm stuck, how do I cancel the SPAM task with the object given in currentTasks?
<Task pending name='SPAM' coro=<spamTest() running at c:\scripts\marketNotifier\marketNotifierDiscord.py:187> wait_for=<Future pending cb=[Task.task_wakeup()]> cb=[_ClientEventTask.task_wakeup()]>
....
....
No, iirc testserverid and/or test_guilds are made for testing slash commands (if u didnt use "testguilds" then you'll need to wait around 1h to use the commands)
Correct me if im wrong 
^
nextcord is not even in my requrements.txt
Because I’m gonna use it in discord.py :-:
Oh k
I removed disnake
well, you sure have it already installed for some reason
Yeah ill uninstall
i don't get it why you installed all 3 in the first place lol
alright uninstalled
I just did pip freeze at some point and copied everything and put it in the requirements.txt
keep just one, preferably disnake
I just want to get slash commands man
its just not working for me 
and I don't get it
Use disnake 🤌
Yeah but I just don't understand it with like the testserver ID etc
:3
Yeah but also after 1 hour test the commands?
No
1h (or maybe less) for global 
What
Like imagine I do all the disnake stuff and don't include the test id server then I can instantly just see the slash command and test it
I am Getting this error of youtube-dl how to solve this?
!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)
we can't help you on that @steep estuary
can't help on that ¯_(ツ)_/¯
anyone have tips on emoji uploads
always seem to come out blurry
best format to upload in?
Goodmorning
hey im using discord py v2 how can i use a on message delete in a cog
@commands.Cog.listener()
async def on_message(...):
. . .
thanks
!d discord.on_message_delete
@commands.Cog.listener()
async def on_message_delete(message): #add self as first argument if inside cog class
...
bro
you said add self argument if in a class when a Cog is a subclass
Wow never knew
...

That's obvious
Hunter do you use MongoDB?
I don't make discord bots, specifically don't make programs which need DBs
F
@bot.command()
@commands.has_permissions(kick_members=True, administrator=True)
async def kick(ctx,*, ma: discord.Member, reason=None):
try:
await ctx.guild.kick(ma)
await ctx.send("Done!")
except:
ctx.send("Please mention the member you want to kick")
discord.ext.commands.errors.MissingRequiredArgument: ma is a required argument that is missing.
HELP please fix it if you can
firstly, you cant catch MissingRequiredArgument exception with a try-except
Only one kwarg allowed
how? can you fix it please?
Only one arg after *
how do i make it send a message in the discord channel once it has connected
@client.event
async def on_ready():
print(f'{client.user.name} has connected to Discord!')
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.
Perhaps
can you find what i'm doing wrong? im trying to follow a tutorial but the bot isn't working.
import os
import discord
from dotenv import load_dotenv
load_dotenv()
TOKEN = os.getenv('DISCORD_TOKEN')
GUILD = os.getenv("DISCORD_GUILD")
client = discord.Client()
@client.event
async def on_ready():
print(f'{client.user.name} has connected to Discord!')
@client.event
async def on_message(message):
if 'test' in message.content.lower():
await message.channel.send('test')
client.run(TOKEN)
even though discord downscales your emojis apparently you need to upload in 128x128 to get non blurry ones

there is none
it wouldnt matter
~/HumphreyBot$ python3 bot.py
Humphrey has connected to Discord!
theyre both events but trigger in different circumstances
can the colored text be used in bot embeds? The ainsi
Yea
but yes if we are talking about when the bot connects to the gateway its on_connect
but ainsi support isn't fully released for all users right?
It works for PC, not for phones iirc
i'm on pc
And it doesn't work?
no
i am copying the example in the pins
\u001b[0;40m\u001b[1;32mThat's some cool formatted text right?
\u001b[1;40;32mThat's some cool formatted text right?
is it colored for anyone else?
nope
huh...weird
👋
maybe what i inputted was wrong then
is it in a ansi code block?
\u001b[0;40m\u001b[1;32mThat's some cool formatted text right?
\u001b[1;40;32mThat's some cool formatted text right?
Still doesn't work?
nope
no
Whats that
Then yea, it doesn't work for everyone
@client.command() async def eval(ctx, input:str): result = eval(input) result2 = result type1 = type(result) await ctx.send(f"```{result2}```\n```{type1}```")
any prob in my code?
Yes
what?
!d exec is what u should use
exec(object[, globals[, locals]])```
This function supports dynamic execution of Python code. *object* must be either a string or a code object. If it is a string, the string is parsed as a suite of Python statements which is then executed (unless a syntax error occurs). [1](https://docs.python.org/3/library/functions.html#id2) If it is a code object, it is simply executed. In all cases, the code that’s executed is expected to be valid as file input (see the section [File input](https://docs.python.org/3/reference/toplevel_components.html#file-input) in the Reference Manual). Be aware that the [`nonlocal`](https://docs.python.org/3/reference/simple_stmts.html#nonlocal), [`yield`](https://docs.python.org/3/reference/simple_stmts.html#yield), and [`return`](https://docs.python.org/3/reference/simple_stmts.html#return) statements may not be used outside of function definitions even within the context of code passed to the [`exec()`](https://docs.python.org/3/library/functions.html#exec "exec") function. The return value is `None`.
ok thnks
@maiden fable is this what i am suposed to do?
can someone explain the error for this to me?
import os
import discord
from dotenv import load_dotenv
load_dotenv()
TOKEN = os.environ['DISCORD_TOKEN']
GUILD = os.environ['DISCORD_GUILD']
error:
Traceback (most recent call last):
File "bot.py", line 9, in <module>
GUILD = os.environ['DISCORD_GUILD']
File "/nix/store/xd5m4hym6gjmdfl0hx1xpj4j2hlc54xx-python3-3.8.12/lib/python3.8/os.py", line 675, in __getitem__
raise KeyError(key) from None
KeyError: 'DISCORD_GUILD'
discord_guild doesnt exist or the capitalization is wrong
no it does exist. (im using replit becuz reasons)
norepl
well that should be the only reason you're getting a keyerror
What reasons 🗿
repl is bad
python blocked on school computers
There is no reason to use it over VSCode or other ide
hein?
unless you want to pursue coding but you dont have the right tools (like a windows / linux operating system)
even macos
I have all kinds of programming shit in my school computer
repl has shared ips so its bad
even if u wanna pursue dont use repl
just not chromebook
Python, Rust, .NET, VS, VSCode, etc
they block everything on my school computer
alternatives are good but i used to use replit for collaboration until i got my first pc
its only using my magic powers i found how to acess discord
even python
ask for an admin password?
8 different overlapping proxies literally crashed my schools detection system
💀💀
there are a list of reasons on why you shouldnt use repl
which ive read and ive switched dw abt me
the amount of times ive used kill 1 is just incredible
i replaced the env in the program with the actual values, and there are no more errors but the program still doesnt work
# bot.py
import os
import discord
from dotenv import load_dotenv
load_dotenv()
TOKEN = there is something here dw about it
GUILD = 'headspace'
client = discord.Client()
@client.event
async def on_ready():
print(f'{client.user.name} has connected to Discord!')
@client.event
async def on_message(message):
if 'test' in message.content.lower():
await message.channel.send('test')
client.run(TOKEN)
when i send test
its supposed to say test
as well
but nothing happens
what
what was that reply
Dw about it
why delete
So you don't see
probably because you have the wrong values? idk
client.run(os.environ['token'])
no need for the variable
Does it print the message when it's ready?
what are "scopes" in discord dev portal?
no
its not printing anything
That's in replit right
yes
o
Did you actually try to run it with the wrong name
no
still nothing
scopes define the permissions an application will have when a user wants to authorize them, e.g. accessing their email, their list of guilds, or adding a bot to their guild






