@bot.command()
@commands.is_owner()
async def addchannel(ctx: commands.Context, channel: discord.TextChannel) -> None:
async with aiofiles.open('allowed_channels.txt', mode='a') as f:
contents = await f.read()
if channel.id not in contents:
await ctx.reply("Successfully added!")
await f.write(f"\n{channel.id}")
await f.write("\n")
else:
await ctx.reply("Already there!")``` still doesnt work
#discord-bots
1 messages Β· Page 46 of 1
Mmm is there any chance we are getting new api stuff in discord.py?
wdym new api stuff?
mh? discord.py 2.0 include all the new things
Slash commands ,buttons that kinda of stuff
^
!pypi discord.py
go use them
Can you give me a example for slash commands in discord.py 2.0?
Shouldn't it be
@commands.has_any_role('')```
no, something like
class Bot(commands.Bot):
def __init__(self):
super().__init__(...)
self.add_command(self.uwu)
@commands.command()
async def uwu(self, ctx): ...```
modifications can be done as required
oh
I'm totally not sure how it would work since never tried it, i might be wrong
are you getting any errors?
That too my much for my little brain 
nope
How do i add options that only allow to choose channels?
i dont understand what people even ask for if that is considered as shit π
bruh, it blocked the link
check if the channel id in (allowed_channels_here), I guess
Typehint a parameter with discord.TextChannel or other channel types
@unkempt canyon do you have antirickroll or what?
at least read it
typehint the argument as typing.Union[discord.VoiceChannel, discord.TextChannel] or discord.abc.GuildChannel
Mmmm
and get category
Where do i put it 
?tag typehinting
This is not a Modmail thread.
gah
I need a full blown video tutorial 
!typehint
Type Hints
A type hint indicates what type a variable is expected to be.
def add(a: int, b: int) -> int:
return a + b
The type hints indicate that for our add function the parameters a and b should be integers, and the function should return an integer when called.
It's important to note these are just hints and are not enforced at runtime.
add("hello ", "world")
The above code won't error even though it doesn't follow the function's type hints; the two strings will be concatenated as normal.
Third party tools like mypy can validate your code to ensure it is type hinted correctly. This can help you identify potentially buggy code, for example it would error on the second example as our add function is not intended to concatenate strings.
mypy's documentation contains useful information on type hinting, and for more information check out this documentation page.
learning python exists, nobody's going to make a "discord.pyXpython" video lmao
so why doesn't this work?
discord.py does too...
noooo
It's simpler
pycord is shittier, use disnake
Discord.py doesn't have good documentation for slash commands
what....
b-b-b-bruh
2nd pin, link what i just sent, rickroll
don't
pov: stable/index.html
there's an example too in discord.py π
i just wrote it myself
I had examples in the gist too...
the code doesnt send why?
nice formatting
Woops
πππ
@bot.command()
async def rules(ctx):
embed=discord.Embed(title="1. No NSFW Content this includes links, images, featuring 18+ content. 2. No gambiling this includes flip, stake and any other betting sites. 3. Please do not use this server as a market place ! 4. No self promo or spam without permission from a mod or owner. (this includes advertisments and invite links) 5. Any users who fail to follow discords terms will be prosecuted. π https://discord.com/terms")
await ctx.send(embed=embed)
There
errors?
how do you know it runs
bro when I nuke a channel/purge a channel how can I make the bot say Cleared by {user} i've tried a bunch of ways
Hmmmm your bot?
did you use On_message?
No.
Your making a nuke bot aren't you?
yea I'm trying to get it to say this when i clear a channel Cleared by {author}
no purge command
Send your code and sure
store the purge method in a variable and use the len functio
messages = await channel.purge()
len(messages) ```
async def nuke(ctx, amount=10000000):
await ctx.channel.purge(limit=amount)
await ctx.send("Cleared by ``{user}``")```
Or do that
what thats not a thing either
ctx.author
instead of user
Yup
I think that you're exceeding the characters limit for the embed title
@bot.command()
async def nuke(ctx, amount=10000000):
await ctx.channel.purge(limit=amount)
await ctx.send("Cleared by ``{ctx.author}``")```
for the tags is it {member.discriminator} ?
So how would i fix it??
probably the title limit is exceeding, try putting that text in the description
Okay
set a shorter title and move the rules in the embed description
No ctx.author also has name and discriminator
I did
and
Bot got destroyed
it does that
nice
!f-string
Creating a Python string with your variables using the + operator can be difficult to write and read. F-strings (format-strings) make it easy to insert values into a string. If you put an f in front of the first quote, you can then put Python expressions between curly braces in the string.
>>> snake = "pythons"
>>> number = 21
>>> f"There are {number * 2} {snake} on the plane."
"There are 42 pythons on the plane."
Note that even when you include an expression that isn't a string, like number * 2, Python will convert it to a string for you.
It isn't a f string
oh
floppy
disk
Yea?
swear that you wont use pycord

is cute
you should write your own library instead of using pycord, it would be better
||I might be using it now||
the touch is

baking*
Bake
the cake or...
can someone help me make a simple join on dm message for all servers my bot is in i wanna make the bot say the support server?

Just use on_member_join event

!on_member_join
both
Mm
idk what to do after that π
Let me get the doc
async def on_member_join():``` is what ik how to do
!d discord.on_member_join
discord.on_member_join(member)```
Called when a [`Member`](https://discordpy.readthedocs.io/en/latest/api.html#discord.Member "discord.Member") joins a [`Guild`](https://discordpy.readthedocs.io/en/latest/api.html#discord.Guild "discord.Guild").
This requires [`Intents.members`](https://discordpy.readthedocs.io/en/latest/api.html#discord.Intents.members "discord.Intents.members") to be enabled.
Pass memeber in
to send message to joined members through dm await member.send(yourShitHere)
!d discord.Member.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/latest/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/latest/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/latest/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/latest/api.html#discord.Embed "discord.Embed") objects. **Specifying both parameters will lead to an exception**.
π¦
Ashley
websi
So no async def? just async
...
async def
ik
lmao
i wanted to see what yall would say
good morning

do i use async or await 

async with def as fn:
await fn foo():
async with print as p:
await print("uwu")
yes.
async def on_member_join(member):
await member.send(yourShitHere)
do I make it a event
morning web
sence it isnt a command
that's obvious
Guys i made a comand that takes a user argument like this mem:discord.Member the mem will be the member object and i can i do this await mem.timeout?
thats all I need correct?
yes you can
async def on_member_join(member):
await member.send("Why did you join")β
await memeber.guild.ban(member)

the decorator is not included in my example
im back once again
what are you doing currently
in this example from Danny himself, he puts self.tree.sync in the setup_hook method, but when i do the same i get a 403 forbidden error
https://github.com/Rapptz/discord.py/blob/master/examples/advanced_startup.py
GitHub
An API wrapper for Discord written in Python. Contribute to Rapptz/discord.py development by creating an account on GitHub.
Traceback (most recent call last):
File "D:\Projects\temp\yuno\bot.py", line 81, in <module>
bot.run(os.getenv('DISCORD_TOKEN'))
File "D:\Projects\temp\yuno\.venv\lib\site-packages\discord\client.py", line 828, in run
asyncio.run(runner())
File "C:\Program Files\Python\3.10\lib\asyncio\runners.py", line 44, in run
return loop.run_until_complete(main)
File "C:\Program Files\Python\3.10\lib\asyncio\base_events.py", line 646, in run_until_complete
return future.result()
File "D:\Projects\temp\yuno\.venv\lib\site-packages\discord\client.py", line 817, in runner
await self.start(token, reconnect=reconnect)
File "D:\Projects\temp\yuno\.venv\lib\site-packages\discord\client.py", line 745, in start
await self.login(token)
File "D:\Projects\temp\yuno\.venv\lib\site-packages\discord\client.py", line 589, in login
await self.setup_hook()
File "D:\Projects\temp\yuno\bot.py", line 42, in setup_hook
await self.tree.sync(guild=guild)
File "D:\Projects\temp\yuno\.venv\lib\site-packages\discord\app_commands\tree.py", line 1070, in sync
data = await self._http.bulk_upsert_guild_commands(self.client.application_id, guild.id, payload=payload)
File "D:\Projects\temp\yuno\.venv\lib\site-packages\discord\http.py", line 738, in request
raise Forbidden(response, data)
discord.errors.Forbidden: 403 Forbidden (error code: 50001): Missing Access
how do i import from another directory
trying to organize code, in font i want to import something from config
you need an __init__.py file in each folder, empty is fine, and then do from config import config or from utils.font import SomeName
he's Danny, he can do everything
the problem is im not Danny, so i guess i cant use the example code π
thanks, i got it workin
is doing stuff like this to make things a fraction faster and life easier dumb? 
so if i need a link button i can just do link.button.patreon
Enum exists
you are missing the applications.commands scope
oh π€¦
Why do i get MISSING ACCESS when trying to sync my tree to a guild?
The bot does not have the applications.commands scope.
All you have to do is go to https://discord.com/developers/applications/ and follow steps shown below:
https://media.discordapp.net/attachments/381965515721146390/957385902735364186/unknown.png?width=1440&height=515
You do not have to kick your bot from the guild, just re-invite it with the generated URL.
_ _
probably shouldnt be coding at 5 am
looked into enum, idk if it's that useful here seeing as im the only person working on the code 
how many gists do you have about dpy
it's useful
after discord.py docs these are the best docs
only two
thanks 
extensions=[
'cogs.afk',
'cogs.anime',
'cogs.chatbot',
'cogs.embeds',
'cogs.events',
'cogs.fun',
'cogs.minigames',
'cogs.moderation',
'cogs.nsfw'
]
if __name__ == "__main__":
for extension in extensions:
try:
await bot.load_extension(extension)
except Exception as e:
print(f"Error loading the {extension}", file=sys.stderr)
traceback.print_exc()
await bot.load_extension("jishaku")
the error is pretty self explanatory
it is showing that it was never awaited if i dont use await
await keyword can only be used inside async function
can you explain?
ohk
I'm sending a message for you
A change in discord.py 2.0 made all methods related to extensions & cogs async.
Bot.load_extension(), Bot.unload_extension(), Bot.reload_extension(), Bot.add_cog(), and Bot.remove_cog are all coroutines now. This means you need to await them. Functions setup and teardown in extensions must be coroutines now. This means you need to define them with async def.
What is the purpose of this change?
It allows the setup and teardown functions of extensions to be coroutines.
async def setup(bot):
await bot.add_cog(Commands(bot))
async def teardown(bot):
return
View more:
Read more about the changes and how you can start your bot here: https://discordpy.readthedocs.io/en/latest/migrating.html#migrating-2-0-commands-extension-cog-async
what should i do here?
ight its loading
got it
class MyBot(commands.Bot):
async def setup_hook(self):
await self.load_extension('my_extension')
in 'my_extension' place, i can make a list called extensions or so and replace it without ''???
yeah, for extension in extensions_list: await self.load...
or instead of doing that
import os
#an async context
[await self.load_extension(f"cogs.{file[:-3]}") for file in os.listdir("cogs") if file.endswith(".py") and not file.startswith("_")]
that basically prevents you from having to have a list of all cogs
it dynamically searches for any cogs even if you add new ones
figured that much
thx

can't he use async for?
but why....
coz watermelon says so
then watermelon is a bad suggester
it's you
π¦
aight so i finally got my slash command to work
only problem now is, after syncing to a specific guild while testing, and then syncing globally, i have duplicate commands in my testing server
is there a way to clear guild-specific commands and only keep the global ones?

either clear all the slashes and sync again
or deal with it
then how does discord.py expect us to handle all these commands
handle?
how exactly do i clear them?
just
comment out all of them and run your bot which will sync an empty tree with the api, and then uncomment your commands and run it and it'll sync all the commands to the api
yes it is
*cough* wonder what this is
hm ic, thanks 
but whatever way works
you'll have to still run the code twice
now to make it automatically clear any guild-specific commands when doing a global sync....
looks like im not getting any sleep tonight 
use the guild kwarg
self.bot.tree.clear_commands(guild=discord.Object(id=1234567890987654321))
yes, but i want to clear guild-specific commands in any guild, so looks like i'll have to fetch
.
and sync the commands since it only clears the commands from the local cache
for guild in self.bot.guilds:
self.bot.tree.clear_commands(guild=guild)
self.bot.tree.sync(guild=guild)
self.bot.tree.sync()
idk why im typing this here and not in my ide
stop syncing every iteration
syncing global commands doesnt affect guild commands
also if you wanna clear all the commands, just dont specify the guild kwarg
yes.
I know
if i just clear global commands, all the testing commands will stay
so i need to get rid of those
theres only 2 guilds anyways
Hey @cerulean shale!
You either uploaded a .txt file or entered a message that was too long. Please use our paste bin instead.
whadda ya know it works perfectly
why are you asking?
it aint loading
i recently decided to shift to cogs
a lot of those error handlers should be condensed into a global handler instead of command-specific ones
i made a load command but even then it aint, it is not even giving any errors
that might be the issue???
maybe. I'm just saying it's a lot of unnecessary code
Guys why i am getting this error
Missing Permissions
But i have permissions
There are are like 4 different errors here
are you printing the error in your handler
ok i will change it
No in the comand error listener
Do i do raise error?
raise the error or use the traceback module
Ok I'll use traceback module
@commands.hybrid_command(name='response' , description = 'Gives The Response')
@app_commands.guilds(1008758498789695508)
@app_commands.checks.has_role(1010100433538273300)
async def response(self,ctx, * , member : discord.Member , response : Literal['accept', 'reject']):
channel = self.client.get_channel(1010106207865933934)
if (response == 'accept'):
await channel.send(f'{member.mention} has been accepted')
await ctx.send(f" {member}'s Form ||Accepted|| By {ctx.author.mention}")
if (response == 'reject'):
await channel.send(f'{member.mention} has been declined')
await ctx.send(f" {member}'s Form ||Rejected|| By {ctx.author.mention}")```
this is my code
this command is not working
but the slash command is working
I got this error
well it's giving you Missing Permissions for something
But bro i have permissions
can i do this?
@commands.Cog.listener()
async def on_message(self, message):
if message.author == bot.user:
return
elif message.content.lower() == 'no u':
await message.channel.send('no u')
elif message.content.lower() == 'f':
await message.channel.send(f'{message.author.display_name} paid their respects.')
elif message.content.startswith('i am'):
value = message.content.split("i am ", 1)[1]
await message.channel.send(f'Hello {value}, I am Dad.')
elif message.content.startswith('imagine'):
value = message.content.split("imagine ", 1)[1]
await message.channel.send(f'I can\'t even imagine {value}.')
role hierarchy matters too
I have highest role ;-;
!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.
exactly?
the bot's role needs to be higher than whoever it's doing an action on
I tried to apply timeout on the bot itself
Is there any error handler that notifies when bot need higher role?
just usual error handler
and check if isinstance(error, commands.MissingPermissions)
can i? or is there any error in it?
@bot.command()
@commands.is_owner()
async def addchannel(ctx: commands.Context, channel: discord.TextChannel) -> None:
async with aiofiles.open('allowed_channels.txt', mode='a') as f:
contents = await f.read()
if channel.id not in contents:
await ctx.reply("Successfully added!")
await f.write(f"\n{channel.id}")
await f.write("\n")
else:
await ctx.reply("Already there!")``` why doesn't that work? no output or errors
is there any tutorial?
im not sure, if you google it you'll probably find something since they are very common forms of serialization
https://www.w3schools.com/python/python_json.asp this tutorial?
yeah, there is pretty much enough for you
that doesn't show how to use it with files
oh yeah bruh
this is better @deep osprey
depending on what you're doing a db might be better as well
which is easier and faster?
just go here https://realpython.com/python-json/#serializing-json
there is about files
well it depends on what all you're storing
@mute.error
async def muteerr(self,ctx,error):
if isinstance(error, commands.MissingPermissions):
embe = errorembed.error()
embed = embe.perm("kick_members")
await ctx.send(embed=embed)
Guys why this error handler not working
My bot is raising the error instead of handling it
if you're just going to be storing channel IDs json is fine
i am just storing channel ids
what is errorembed
show it's code
That have not error
@robust fulcrum
Fine
class error:
def missingargs(self,args):
args = str(args)
embed = Embed(
title = "Missing argument ",
description = f"`{args}` was not provided",
color = Color.red()
)
return embed
def voiceerror(self):
embed = Embed(
title = "Voice channel",
description = f"Please join a voice channel first",
color = Color.red()
)
return embed
def perm(self,perm):
embed = Embed(
title = "Missing permission",
description = f"Missing `{perm}` permission",
color = Color.red()
)
return embed

I love coding bots but there is no way to get it 24/7
check threads of this channel
data = {
"channels": {
"id1": "112233",
"id2": "332211"
}
}``` so is this an example of json file?
@silk fulcrum
i see
So?
{
"channels": {
"id1": "112233",
"id2": "332211"
}
}
try printing something after you provide if, like py if isinstance(...): print('here') ...
Okay
{
"channel_ids": [
111214324,
152135239
]
}```
It not printed
do print(type(error)) before the if
channels = [111,222,333] ?
json?
Json != Dictionary
[
111,
22,
33,
]
Nothing was printed
then your error handler doesn't get triggrered
Hmmm
Hey
!e ```py
import json
json.loads("[1,2,3]")
@vocal snow :warning: Your 3.11 eval job has completed with return code 0.
[No output]
^
What should I do now?
if you dont have error handler what happens?
Error raises?
what error
can you send traceback?
Ok
{"channels":[11243241, 13251236]}``` so this should be my json file?
no
[35435425, 575868]``` should be in it
just a list without a name?
then how am I gonna check if the channel.id in that json file?
sorry but I still don't get why using json is better than using .txt file?
It handles the serialization for you
And if required you can store more complex data
Besides, txt files aren't meant for this
so do I have to add manually channel ids in the code of the bot?
or the command handles that?
I'm not sure what you're saying
In the command you just append the new channel ID to the list
without json, it does that but when I restart my bot, channel ids are removed
would json fix that?
channels = [1008214910498508872]
@bot.command()
@commands.is_owner()
async def addchannel(ctx: commands.Context, channel: discord.TextChannel) -> None:
with open("data.json", "w+") as f:
json.dump(channels,f)``` so this should be my code?
why you have channel as parameter if you don't use it
I will use it later but I am just making sure if this is the correct way
!d json.dump takes 2 arguments at least
json.dump(obj, fp, *, skipkeys=False, ensure_ascii=True, check_circular=True, allow_nan=True, cls=None, indent=None, separators=None, default=None, sort_keys=False, **kw)```
Serialize *obj* as a JSON formatted stream to *fp* (a `.write()`-supporting [file-like object](https://docs.python.org/3/glossary.html#term-file-like-object)) using this [conversion table](https://docs.python.org/3/library/json.html#py-to-json-table).
If *skipkeys* is true (default: `False`), then dict keys that are not of a basic type ([`str`](https://docs.python.org/3/library/stdtypes.html#str "str"), [`int`](https://docs.python.org/3/library/functions.html#int "int"), [`float`](https://docs.python.org/3/library/functions.html#float "float"), [`bool`](https://docs.python.org/3/library/functions.html#bool "bool"), `None`) will be skipped instead of raising a [`TypeError`](https://docs.python.org/3/library/exceptions.html#TypeError "TypeError").
The [`json`](https://docs.python.org/3/library/json.html#module-json "json: Encode and decode the JSON format.") module always produces [`str`](https://docs.python.org/3/library/stdtypes.html#str "str") objects, not [`bytes`](https://docs.python.org/3/library/stdtypes.html#bytes "bytes") objects. Therefore, `fp.write()` must support [`str`](https://docs.python.org/3/library/stdtypes.html#str "str") input.
If *ensure\_ascii* is true (the default), the output is guaranteed to have all incoming non-ASCII characters escaped. If *ensure\_ascii* is false, these characters will be output as-is.
done
no.
Error encountered!
Loading chunk 2271 failed. (error: https://discord.com/assets/d118978bc6ebdcf4a0b9.js)
o
just had to clear cache
problem fixed
This is not 100% discord-bot related, but I would like some help. I am trying to make a leveling system, that every message is around 20 xp. I am having trouble on how to make the ranks, as in what rank should the member be by his xp. I need an algorithm I guess, but no idea what algo and how to use it in the code. Anyone can suggest any idea?
is there a way to get rid of these kind of errors? Ignoring exception in command None: discord.ext.commands.errors.CommandNotFound: Command "suuke" is not found
I generally do something like
next_level = int(experience ** (1/4))
if current_level < next_level:
#do stuff
but okay, since there are a lot of other ways to do the same
@bot.command(aliases=['makerole'])
@commands.is_owner()
async def createrole(ctx, *, name):
embed = discord.Embed(
title=f"""**{ctx.author.name} Created A Role Named: | {name} | **""",
color=000000)
guild = ctx.guild
await guild.create_role(name=name)
await ctx.reply(embed=embed)``` ```py
File "main.py", line 480
async def createrole(ctx, *, name):
^
SyntaxError: invalid synta``` whats going on with replit lmao how can i fix this?
Send full code
oh wait nvm i fixed it
i want to use rgb colors in a embed i tried this: py color=discord.Color.from_rgb(ff0000))) but it didnt work
classmethod from_rgb(r, g, b)```
Constructs a [`Colour`](https://discordpy.readthedocs.io/en/latest/api.html#discord.Colour "discord.Colour") from an RGB tuple.
See the params
so what do i need to change?
That's for you to decide
io wanna make it respond
huh?
The application did not respond
if (response.lower() == 'accept'):
response = discord.Embed(title='Form Response' , description = f"**Hey {member.name} , \n \n :aarow: Your form has been accepted..! :555rainbowhearts: \n :aarow: Go Through The Rule Book Once :receipt: \n :aarow: Make sure to go through [#1010106220755034132](/guild/267624335836053506/channel/1010106220755034132/) to get the server iP and Hop in !! \n \n Happy RPing..!! **", color=0xa434eb)
response.set_footer(icon_url=member.avatar)
response.set_thumbnail(url = guild.icon)
await channel.send(member.mention,embed = response )
await member.add_roles(role)
await ctx.response.send_message("Done!!")
await log.send(f" {member}'s Form ||Accepted|| By {ctx.author.mention}")```
If you want to use a hex value then you can pass a hex literal to discord.Color directly
is that a prefix command?
nice python syntax
slash command
then why are you using ctx?
interaction is the convention for that. ctx is convention for prefix commands
!d discord.Interaction
class discord.Interaction```
Represents a Discord interaction.
An interaction happens when a user does an action that needs to be notified. Current examples are slash commands and components.
New in version 2.0.
Use attributes from the class above
never used that. Not sure how it works
Ever saw the ctx and interaction meme? π
Uhh no I don't think so
Why are programming memes so cringe
i can't take any more organizing but i've only finished the config and utils so far 
why-
when each file has 1 line of code
too smart
it's just under 5k lines of code total
that's not much corresponding to the amount of files
that's even further going than django
idk, all the sections make sense in my brain and they're all probably going to grow in size by the time im done 
that's cool, all the best 
Why u using the pickle module tho? π
Courtesy of disnake
Guys how can I check the user have mute permission (text channels)?
stuff that isn't really important or worth making a table for
should probably at some point
Mute permission?
Tf is that?
okay...
you never throw stuff in pickle when you're being lazy?
Marshal !!
Ngl, I am hearing the module's name first time but people say pickle is better?
I never used pickle except for school lol
Not any object iirc
U can't throw in things like invite objects, can u?
you can't put in discord objects, tried that when i was first starting out 
That's sad ngl
I made entire "database" based on pickle files
It was breaking every month and I was losing all the data lmfao
you meant timing members out?
!d discord.Permissions.moderate_members
Returns True if a user can time out other members.
New in version 2.0.
Thanks
how to make welcome messgae in nextcord? Video's code not working
video tutorials for discord bots on python are really bad
hi guys how can i add a button to button. i have a shop command (.shop) which brings up multiple buttons to different things i sell. once theyβve chosen a tool to preview i want to add a buy button and a back button. can anyone help me with that
to add buttons to the view you just do view.add_item(new_button) for each button and then edit the message with that view await message.edit(..., view=view)
what did you not unsertand?
well ik how to add buttons with .add_item
if you want to remove a button and place the other instead do view.remove_item(old_button) and then view.add_item(new_button)
ye i donβt want remove it i just want to add a button to the new message
itβs kind of hard to explain iβll try find an example
ok...
Just delete main shop message and send the new with the new view, that's the common practice
why not edit
thats common practice? you can edit the message with your new components too
Why are people so word picky
π€ π³
why is the implementation of interactions so bad
blame discord API for that
how would that work though because iβm not trying to just edit or delete the button iβm trying to add a new one once theyβve clicked on a button
nah I literally mean danny changed everything but it was so unnecessary
Dani sounds like Danny π
what's the point of interaction.send_message instead of interaction.send
it's so inconsistent
because when u make a button and press it it gets rid of what u just pressed
I agree!
@slate swan id suggest having your view keep track of which item the user has selected and on click, update all the buttons your view will have afterwards
wasn't it create_response or something?
thatβs exactly what i want but have no clue how to do that lmao
or maybe im mixing up libraries
Ikr that's why I prefer disnake
^ lol
yeah... hikari maybe?
they renamed some stuff from message to response though
cus there is send_modal
is a modal sent in a message
Why is it named like some anime thing
hikari weird
hikaru is a chess grandmaster π
its just a word for light
its a Japanese word for light
nakamura
magnus carlsen
andrew tate's dad
Yes but I doubt the lib was named in his honor
ofc it was
Ah so that's why there's lightbulb thing or smth
light.lightbulb
store the state you need in your View like the list of tools, which tool is selected, etc., and you can update your embed+buttons whenever the user clicks based on your state
its a command handled , just like discord.py has discord.ext.commands
Can u send me link because i cant find it
hikari tends to be low levelled
!d nextcord.on_member_join
btw hikaru has a meme about lightbulb
so it does not have an inbuilt cmd handler
nextcord.on_member_join(member)``````py
nextcord.on_member_remove(member)```
Called when a [`Member`](https://nextcord.readthedocs.io/en/latest/api.html#nextcord.Member "nextcord.Member") leaves or joins a [`Guild`](https://nextcord.readthedocs.io/en/latest/api.html#nextcord.Guild "nextcord.Guild").
This requires [`Intents.members`](https://nextcord.readthedocs.io/en/latest/api.html#nextcord.Intents.members "nextcord.Intents.members") to be enabled.
@slate swan
coincidence? I don't think so
Listen for this
ok thanks iβll try that and lyk if i need any help
What does discord API wrapper have to do with a chess grandmaster (same question for "light" but ok)
wrap him using discord API
Ah yes, that's the common practice
Hello, I have a Discord bot in Python. There is an embed message in the ticket section of my bot. To open the ticket, I want to change the message in the embed and send the embed again.
can you be more specific please?
Changes in the embed and sending it again in the channel
uh then you wish to delete this?, cuz then you will have to code the second embed and again send it like u sent the first one.
You can do something along the lines of
emb = discord.Embed(description="hi")
msg = await ctx.send(embed=emb)
emb.description = "hello"
await msg.edit(embed=emb)
This is an example
Just assign your embed object to a variable. Edit it after you send the original embed and edit the message you sent with the new embed
@client.slash_command(name='emojiinfo', description='Shows info about an emoji')
async def infofemoji(ctx, emoji:str=SlashOption(description='Valid emoji in the server')):
name = emoji.name
im trying to make an emoji info command
As you can see here I passed in emoji as str and it gives me error saying that str object has no attribute name
If i try to pass in emoji as nextcord.Emoji it will not work as nextcord.Emoji cant be used in slash commands
Is there a way i can resolve this issue??
What can you do with discord.py without creating a bot account
There's no way to interact with discord without a bot account then?
it's designed for discord bots so
idk maybe im stupid and it has functionalities for applications, not bots
but iirc it doesn't
I'm trying to pull some messages from a group dm automatically, is that possible?
RestCord exist
Itβs not python tho
Itβs php.
Idk php
Is there a way to do this
idk about all of that.
!pypi restcord
wait what π³
I see
Why not allow self bots and give them limited access
It seems self bots are useful
oh that is not the same as php's restcord lmao
I only knew of phps restcord π€·ββοΈ
I don't know how to code
Anyone can help me solve this...
self Bots already have ratelimit and token but they're not documented and they're not meant to be used as automized script/app (do you think that your account doesn't have a limit to the requests that it can make to discord?)
`import restcord
import asyncio
loop = asyncio.get_event_loop()
client = restcord.Restcord(token="Your token here")
async def test():
guild = await client.get_guild("Some guild id of a guild that ur bot/user account is in")
print(guild.dict)
loop.run_until_complete(test())`
In the examples it says this, does that mean you can use it with a user account
I just want to get some messages from a group dm
I recommend not doing whatever you're thinking about doing with that library. No matter if the reason is good or not, Discord doesnβt want you automating your account
from a group Dm you can if you invite your Bot
You can't invite a bot to a group dm
but it should be a Group DM
Ok i understand
can't the Bot create a group Dm?
I'm not sure with the Dm things
How do you even add a bot to your friend list
with the sussy magic
??
imagine being so lonely
its a user-only endpoint so bots cant use it
you can still find it documented in the 1.7.3 version of dpy before they removed support for it entirely
I guess i'll figure something out ty
@client.slash_command(name='emojiinfo', description='Shows info about an emoji')
async def infofemoji(ctx, emoji:str=SlashOption(description='Valid emoji in the server')):
name = emoji.name
im trying to make an emoji info command
As you can see here I passed in emoji as str and it gives me error saying that str object has no attribute name
If i try to pass in emoji as nextcord.Emoji it will not work as nextcord.Emoji cant be used in slash commands
Is there a way i can resolve this issue??
Just make requests to discord API
Well you still need a bot token or your oauth access token
Guys, if you need a bot to do stuff, what are these other checkboxes for
One sec ima link you the table
bot & application.commands ( if you want app commands)
Discord Developer Portal
Integrate your service with Discord β whether it's a bot or a game or whatever your wildest imagination can come up with.
whats the messages.read scope? something like message intents?
These are for oauth
What is an "app" exactly, is it just the program?
An app is one step higher than your bot
A bot is part of an app
An app can also be discord RPC for your game, it can also be an oauth thingy
What's rpc
Rich presence
Mhm ok
A thing registered by your account that allows you to interact with discord API through tokens given by app's oauth
Developers of games can hook up discord to it so that other discord members can see what youβre doing inside of a game
How do i get discord aproval
In case of bots the token is given in a bit different way than oauth
Why do you need this
Isn't that what i'd need to get the messages from the group dm
Why do you need to get messages from there
Cuz people say some funny stuff there and i want to automatically do stuff with it
You can ask discord but I doubt the likelihood of it
Cuz we already have the group dm
is there a way to send a messages for new commits in Github?
why can't you add the bot to your group
Well you are 99% not getting approval from discord with such reason
how
Alright its whatever
or what should i look for
You can't add a bot as a friend
Ah yes pip install pip
Um, actually, you can
I have many friends on discord π€
Screw wrappers I am raw requests man (except discord because too much stuff)
How?
Wut lol
Just name your alt "Bot" and add it
Lol wut then i'd still need a self bot
Don't we all
beep boop baap
;)
there are no examples on how to use it =(
Imagine using github wrapper
bruh i think that lib is dead
ou
What version does github API have rn
so is there any way to send if there's a commit without that library?
just read the docs
https://docs.shiney.dev/github/dotcom/latest/client/client/
Of course just make an API call
where did you j=find that
Why do y'all even use wrappers for so easy APIs
docs links in pypi are not working
why not
from the github repo
bruv
π just create a wrapper in your project
Less dependencies
how that even matter
since PPL made them let's do them a favour and use it
if it's like just a smol usage u can make ur own ig tho
vulnerabilities
import discord
import http
import aiohttp
from discord.utils import get
from discord.ext import commands
from aiohttp import ClientSession
class Chatbot(commands.Cog):
def __init__(self, bot):
self.bot = bot
@commands.Cog.listener()
async def on_message(self, message):
cmdChannel = self.bot.get_channel(1008668481484500992)
inp = message.content
if message.author == self.bot.user:
return
elif message.channel.id != cmdChannel.id:
return
else:
async with aiohttp.ClientSession() as cs:
async with cs.get(f'https://api.popcat.xyz/chatbot?msg={inp}&owner=Ricky&botname=Estelle') as r:
res = await r.json()
await message.send(f"{response}")
async def setup(bot):
await bot.add_cog(Chatbot(bot))
HELP IT AINT WORKING ;-;
@commands.Cog.listener()
async def on_message(self, message):
cmdChannel = self.bot.get_channel(1008668481484500992)
if message.author == self.bot.user:
return
if message.channel.id != cmdChannel.id:
return
msg_content_without_spaces = message.content.replace(" ", "+")
async with aiohttp.ClientSession() as cs:
async with cs.get(f'https://api.popcat.xyz/chatbot?msg={msg_content_without_spaces }&owner=Ricky&botname=Estelle') as r:
res = await r.json()
await message.channel.send(f"{res}")```
2 problems:
- there's no such thing as message.send
- response wasn't defined, you probably meant
res
shouldnt we get the results from api?
- don't make a new
aiohttp.ClientSessionfor every request
- you can't have spaces in urls, so if your message content contained them, your url would've been invalid
spaces usually get replaced by+in urls, but you can use dedicated libs to "convert" strings to valid urls etc
that's not the issue yet
make sure you can send a result back first, before parsing the json π€·ββοΈ
i am shifting over to cogs as my code was getting messy
and i somehow got 2 of my other cogs work
and now i am tryint to fix this cog and i use load command to load the cogs as i am still on fixing my cogs first
i think they use %s instead of +, not too sure though nvm it was some other api
yeah it uses % instead of +
any idea on how i can do it?
just use a lib for that at this point
this
sharing the error would help...
if channel in category.channels:
AttributeError: 'NoneType' object has no attribute 'channels'
yes
I'm not asking you if, I'm asking how
helpcategory = 1010580194916057128
class Dmhelp(commands.Cog):
def init(self, client = commands.Bot):
self.client = client
category = guild.get_channel(helpcategory)
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.
can someone help, my discord bot seems to not be seeing messages or just not replying
if you're on 2.0 make sure to enable message_content intents
how do u do that again? thhx
!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 Members, Message Content, and Presences. These are needed for features such as on_member events, to get access to message content, 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.
!d discord.Intents.message_content
Whether message content, attachments, embeds and components will be available in messages which do not meet the following criteria:
β’ The message was sent by the client
β’ The message was sent in direct messages
β’ The message mentions the client
This applies to the following events...
this is outdated since v2 became stable
the code still works, just the explanation isn't complete
well it does mention message content in the first para
i think its complete, am I missing something
yup, I was wrong
I thought message_content would've been enabled by default in v2, I guess not
let me send my code in as still hvaing an issue π
just the traceback is enough
nice codeblocks
you forgot to pass in the intents in the Client constructor
and consider using the commands extension instead of parsing the command manually
discord.Client(..., intents = intents)
seemed like a copy pasta to me
you have to read through this tho, just copy pasting isn't enough
you most likely never toggled the message content intent on in discord dev portal
putting code examples in tags is a double-edged sword
for key, value in dmhelp.items():
RuntimeError: dictionary changed size during iteration```
@commands.command()
async def closeticket(self,ctx ):
guild = self.client.get_guild(1008758498789695508)
category = guild.get_channel(1010580194916057128)
channel = ctx.channel
if channel in category.channels:
with open(r"dmhelp.json","r") as f:
dmhelp = json.load(f)
for key, value in dmhelp.items():
if value == channel.id:
user = guild.get_member(int(key))
del dmhelp[key]
with open(r"dmhelp.json","w") as f:
json.dump(dmhelp,f,indent=4)
orname = channel.name
await channel.edit(name = f"closed + {orname}")
delticket = discord.Embed(title="Support Team" , description = f"Your Ticket has been closed !!", color = 0x00c8ff)
await user.send(embed = delticket)
a, getting this error
for ... in dmhelp.copy().items()
Also json as a db is bad, you should learn about databases
love the blockingio
i have
current code?
i've a slash command parameter user_id: commands.Range[1, ...] = commands.Param(name="user_id", description="The member to unban") but discord says "enter a valid integer"
how can i solve this problem?
mysql.connector.errors.DatabaseError: 1205 (HY000): Lock wait timeout exceeded; try restarting transaction
Does somebody know why that happens when I run multiple instances of my command?
are you connecting to the database everytime you run the command?
and you should use aiomysql if you aren't already
yes
and I'm closing it
every time
why though
just connect once and use that throughout
could also consider a connection pool
hmmm
Are Options possible in hybrid_commands? Like if I use it same as in an app command will it work for app command and if it works what will it be for a message command?
i'm using disnake, btw it's a discord's shitty problem
makes sense.. Would that fix the issue though?
most likely
!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.
How to make welcome messages (nextcord)
... is not a number is it?
!d disnake.ext.commands.Range
class disnake.ext.commands.Range```
Type depicting a limited range of allowed values.
See [Number Ranges](https://docs.disnake.dev/en/latest/ext/commands/slash_commands.html#param-ranges) for more information.
New in version 2.4.
would it be save to exit my code/shut down my bot without closing connection to database beforehand?
Hello, i keep getting this error
return ctx.message.author.id == ctx.guild.owner.id
AttributeError: 'NoneType' object has no attribute 'id'
Guild.owner is None, you don't have member intents
!d
You can use Literal
But itβs not really great for msg commands cause it doesnβt show the options
!d
#bot-commands
it's elipsis
ids are too long to be integer in discord
really cringe
thats more of a javascript limitation, not Discord's
!black ?
im aware, but does disnake allow that?
!pip black its a package
yes
i see
so the issue was a long integer?
it will work if the table name and attributes given there are correct, and you provide Correct placeholder values while executing the query
syntax wise, its correct
yes
I've type hinted as str
and converted as int in my code
whats the data type of number? you provide a string there
anyone know whas wrtong
from discord.ext import commands
hello am new to python and am trying to make a python bot that logs into my account and searches for channels in all guilds named "test" and posts a specific test if anyone can help me with that lmk pls
you need to import modules before using them sir
the thing is, automating user accounts is against discord ToS and we can't help with that here ( rule 5)
oh i see
you can use a bot for the same purpose
data type of the number column in your table?...
yo how to get guild region? guild.region aint working
you should have used INT or BIGINT for a numerical value
what commands should I use bro
is my message invisible or something?
that feature is deprecated
do you have the UPDATE rostercap in that query or not
and data type for GUILDID?
why don't you check it lol
invisible message is not deprecated
hello, my error keeps saying this.
error: TypeError: on_member_ban() missing 1 required positional argument: 'user'
@bot.event
async def on_member_ban(self, guild, user):
with open('whitelist.json') as f:
whitelisted = json.load(f)
async for i in guild.audit_logs(limit=1, after=datetime.datetime.now() - datetime.timedelta(minutes = 2), action=discord.AuditLogAction.ban):
if str(i.user.id) in whitelisted[str(guild.id)]:
return
await i.user.ban(reason="Azurite Antinuke | Banning Members.")
return
!pypi aiofiles use aiofiles, with open(...) is blocking your code
yea, delete the table and recreate it witj new query
the question was about Guild.region
a
GUILDID should be the primary key with BIGINT data type
NUMBER should be INT or BIGINT
change the number variable to an integer
if its an argument, yes
what are the differences between discord.py and disnake?
UPDATE rostercap
SET NUMBER= %s
WHERE GUILDID = %s
im new to python, where do i place it?
disnake is a fork of discord.py
the major difference between them for now is application commands implementation
disnake is comparatively easier
eh write it inside a string
and the disnake code is the same or similar to discord.py?
like you did earlier
aiofiles is a module
import aiofiles
replace your file operations with
async with aiofiles.open("filename") as f:
content = await f.read()
TypeError: Messageable.send() got an unexpected keyword argument 'components'
90% same, other than app commands
don't use discord-components
i didnt
why are you using the components kwarh then
it's better to spend 2-3 days reading all the documentation if there are any tutorials
idk how to make buttons can you help me?
thought its built in
GitHub
An API wrapper for Discord written in Python. Contribute to Rapptz/discord.py development by creating an account on GitHub.
its nothing too different
most of your old discord.py code will work in Disnake
the docs are similar to discord.py as well
thanks pretty cool π
the bigger changes are in the ui kit
and you think that if I'm just starting with python, I can write in disnake right away or should I learn discord.py
a Discord Bot is not a python begginer project
you should learn python first
like that, but I prefer to learn from something that I will use in practice
What does this mean?
Desktop\VanityBot\bot.py:31: RuntimeWarning: coroutine 'BotBase.load_extension' was never awaited
bot.load_extension(f'cogs.{filename[:-3]}')
RuntimeWarning: Enable tracemalloc to get the object allocation traceback```
**Code**:
```py
for filename in os.listdir('./cogs'):
if filename.endswith('.py'):
bot.load_extension(f'cogs.{filename[:-3]}')```
if u are just starting u prolly don't even know the basics to get started u will just be blindly groping around without a clue
await it
await bot.load_extension(f'cogs.{filename[:-3]}')
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: 'await' outside function
A change in discord.py 2.0 made all methods related to extensions & cogs async.
Bot.load_extension(), Bot.unload_extension(), Bot.reload_extension(), Bot.add_cog(), and Bot.remove_cog are all coroutines now. This means you need to await them. Functions setup and teardown in extensions must be coroutines now. This means you need to define them with async def.
What is the purpose of this change?
It allows the setup and teardown functions of extensions to be coroutines.
async def setup(bot):
await bot.add_cog(Commands(bot))
async def teardown(bot):
return
View more:
Read more about the changes and how you can start your bot here: https://discordpy.readthedocs.io/en/latest/migrating.html#migrating-2-0-commands-extension-cog-async
Read the link
so if i wanted to ad a cog, ill have to do them like this?
class MyBot(commands.Bot):
async def setup_hook(self):
await self.load_extension('f'cogs.{filename[:-3]}'')```
im so confused on this change.
import discord
from discord.ext import commands
intents = discord.Intents.default()
intents.members = True
client = commands.Bot(command_prefix=",", intents=intents)
@client.event
async def on_ready():
print("Ready")
@client.command()
async def hello(ctx):
await ctx.send("Hello I am read Bot")
@client.command()
async def join(ctx):
if (ctx.author.voice):
channel = ctx.message.author.voice.channel
await channel.connect()
else:
await ctx.send("You are not in a voice channel, join a voice channel to run this command!")
@client.command(pass_context = True)
async def leabe(ctx):
if (ctx.voice_client):
await ctx.guild.voice_client.disconnect()
await ctx.send("I left the voice channel")
else:
await ctx.send("I am not in a voice channel")
can someone help^
you could also do
async def main():
async with bot:
await bot.load_extension(...)
# you can also use your
# for loop here to load the
# extensions
await bot.start(TOKEN)
asyncio.run(main())
class MyBot(commands.Bot):
async def setup_hook(self):
await self.load_extension("antinuke.py")```
i can do it like this correct?
you should install PyNaCl
!pypi PyNaCl
it's more complex, the example that I sent is easier
it's better to install it through pip install -U discord.py[voice] 'cause version issues
they're most likely not gonna be used a lot, and probably I will even remove them
thanks btw
If the only thing your subclassing the bot for is setting setup_hook you can just use .event
bot = ...
@bot.event
async def setup_hook() -> None:
...
In a discord embed, how do i add an hyperlink
is the cmd $ pip install pynacl?
how can my bot use emoji of different server in a different server
?
emb = discord.Embed(title="Very good Embed with a hyperlink", description="This is a [hyperlink](https://nevergonnagiveyouup.com/)")```
do \:emoji: to see it's code and then use it for your bot, eg.
\:brainmon: = !brainmon
await ctx.send("My beautiful emoji:  ")```
(works for diff servers too)
i have in this form it working in my server but in different server
most likely your bot doesn't have the permission to send custom emojis
how can i gime >
!d discord.Permissions.use_external_emojis
An alias for external_emojis.
New in version 1.3.
π₯²
how can i use it ?
import discord
from discord.ext import commands
intents = discord.Intents.default()
intents.members = True
client = commands.Bot(command_prefix=",", intents=intents)
@client.event
async def on_ready():
print("Ready")
@client.command()
async def hello(ctx):
await ctx.send("Hello I am read Bot")
@client.command()
async def join(ctx):
if (ctx.author.voice):
channel = ctx.message.author.voice.channel
await channel.connect()
else:
await ctx.send("You are not in a voice channel, join a voice channel to run this command!")
@client.command(pass_context = True)
async def leabe(ctx):
if (ctx.voice_client):
await ctx.guild.voice_client.disconnect()
await ctx.send("I left the voice channel")
else:
await ctx.send("I am not in a voice channel")```
can someone help ^
install pynacl
pip install PyNaCl
wrong python version...
you installed it for python 3.9
and your bot uses 3.10
didnt you have that problem already?
hello, this error is the same thing and i cant install aiofiles due to my school pc
how do i fix this?
@bot.event
async def on_guild_channel_create(self, channel):
with open('whitelist.json') as f:
whitelisted = json.load(f)
async for i in channel.guild.audit_logs(limit=1, after=datetime.datetime.now() - datetime.timedelta(minutes = 2), action=discord.AuditLogAction.channel_create):
if str(i.user.id) in whitelisted[str(channel.guild.id)]:
return
await channel.guild.kick(i.user,reason="AntiNuke: Creating Channels")
return```
? so what do i do..
what? how can't you install aiofiles? how's that possible?
anyways, what's the error?
local host blocks all incoming downloads from pypi and etc.
await coro(*args, **kwargs)
TypeError: on_guild_channel_create() missing 1 required positional argument: 'channel'```
no self
this is not in a cog
so remove it
C:\Users\dynam\AppData\Local\Programs\Python\Python310\python.exe -m pip install PyNaCl, there must be a better way, but im too tired, btw you could've remembered it yourself, cus you had this problem already
async def leave(ctx):
if (ctx.voice_client):
await ctx.guild.voice_client.disconnect()
await ctx.send("I left the voice channel")
else:
await ctx.send("I am not in a voice channel")```
anyone know why my leave command doesn't work the bot says "I am not in a voice channel" even tho it is
nvm it works
@bot.command()
@commands.is_owner()
async def addchannel(ctx: commands.Context, channel: discord.TextChannel) -> None:
with open("data.json", "a") as f:
json.dump(channel.id,f)```how to make this code write channel id in a list because .json file looks like this ```json
112233```
when creating a slash subcommand is it possible to keep the main command function-able?
How do i do it in the title
In the title you can't, you can put an embed "author" though
not possible, only if the whole title will be a hyperlink, then url kwarg
Or maybe it also works in title, it's just a different kwarg
Master32 youre still here?
Yeah makes sense that it works for both kek
emb = discord.Embed(title="Click me!", url="https://never-gonna-give-you-up.com/")```
Thanks
no me not yes, why?
i went to sleep and just woke up and its like you havent moved lol
lmao
delete that screenshot
hide ur token
Reset your token lol
uh you just sent your token
contains your token
sryy
go regenerate it and use environment variables
go reset it
and next time send code not screenshot pls
either way it should be in an env file
go on the developer portal and reset your token now, you never know if there are bots in this server etc.
reset it first
did you regenerate it?
watch the issue be the bot detects its own messages and cause recursion lol
how do i do this for multiple roles?
Main problem for now is the light theme
YE
whats with people sending screenshots
alright, copy-paste the code here with formatting, then we can take a look
!code
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.
Better screenshots than sending code without formatting
so can someone write skript for me?
no
We don't write for you
no. we can help you figure out whats wrong
They guide you and help you figure out what's the issue
!rule 8
8. Do not help with ongoing exams. When helping with homework, help people learn how to do the assignment without doing it for them.
Whats wrong with the color white?π€¨
?
after this, i'll have to teach you about environment variables
?tag lighttheme
This is not a Modmail thread.
uh
:kek:
:lemao:
@rough moss so, could you kindly paste the code here so i can read it?





π
