#discord-bots
1 messages · Page 1090 of 1
in a correct channel, sure
You can check out some of our open source projects @unkempt canyon @lament depot, they should have a constants.py file where we use os.environ.get()
Along with a .env file used in docker-compose.yml, but that serves the purpose of loading in the env variables into the docker container
okay! thanks a lot
oh wait, i made a .env file, wrote TOKEN=xyz in it
then did client.run(os.getenv('TOKEN'))
it didnt work
bot.run(os.getenv("token"))
what is wrong with this? it says token is wrong but the env is spelled token and the value is a valid token
how
can you print it first?
the token ofc
ok
I feel like it's None in your case => not loaded properly
um, how do i do that? like as a string? print("TOKEN_HERE?")
i tried it didnt work
define "it didn't work"
File "main.py", line 15
print(os.getenv("token"))
^
SyntaxError: invalid syntax
@potent spear
you messed up with your previous line
await interaction.response.defer()
# a bunch of stuff
await interaction.response.edit_message(content = None, embed=embed , view=None)
is this the format i'd use if after i click on a button it does a long process?
to make sure it does everything in it
@potent spear i dont see anything wrong at all with the previous lines
it shouldn't be an @
its always been an @
every time in the past ive done it which i cannot count how many times it has needed an @
but whatever, now its saying discord.ui isnt a valid module
I still have to see full error traceback ofc
this time, it doesn't
hi
Traceback (most recent call last):
File "main.py", line 3, in <module>
from discord.ui import Button, View
ModuleNotFoundError: No module named 'discord.ui'
``` ok @potent spear
hi! need help w smth?
did you even install dpy v2?
ive never needed to in the past. just earlier today i tried the same thing and it worked
and i dont have error
you'll have to install dpy v2 first ofc...
import discord
from discord.ui import View, Button
import asyncio
from discord.ext import commands
intents = discord.Intents.default()
intents.members = True
bot = commands.Bot(command_prefix="*", description="bot de test", help_command=None, intents=intents)
@bot.event
async def on_ready():
print("[Steelfri] CashOutBOT Started")
@bot.command()
async def help(ctx, arg=None):
embed = discord.Embed(title="Liste des commandes", url="http://steelfriapi.tk",
description="Voici la liste des commandes :\n", color=0xBF211E)
embed.set_footer(text="CashOutBOT - AdminTools",
icon_url="https://media.discordapp.net/attachments/823517163847417867/983481287237058601/sapphire.png")
embed.set_thumbnail(url="https://media.discordapp.net/attachments/823517163847417867/983481287237058601/sapphire.png")
embed.add_field(name="Requête :", value="`*post`, `*del`, `*delete`", inline=False)
embed.add_field(name="Tag :", value="`*username`, `*setup`", inline=False)
embed.add_field(name="Autres :", value="`*help`", inline=False)
button1 = Button(label="Support", url="http://sapphireapi.tk")
view = View()
view.add_item(button1)
await ctx.send(embed=embed, view=view)
bot.run('token')```
whole code
how do i do that? ive never needed to so how do i do it
you do ofc need it... in v2, you have buttons and slash commands and other types of shit
so how the heck do i do that? ive asked you 3 times now
before I move on with anything, how do you know how to code this without checking the docs? what are your sources?
since if you read the docs, you should've known
i check the docs when told to. i find it easier to ask real people instead of reading bcs if something comes up they are way smarter than a bunch of words
python -m pip install git+https://github.com/rapptz/discord.py
@fallow mauve can u look pls
that's not how you overwrite a help command
how 
bot.remove_command("help")
put that up somehwere near the top of your code
show me whole code
its here
its a old code, i remove that
ok
hold on, so did you copy this code from an older set?
its an old bot and i need the intents
yes, that's ok, setting help_command to none and calling remove_command does the exact same thing, however it is recommended to just set help_command to None
i only copy that
okk thx
ok, also you dont need arg=None do you?
its not the problem
ok
but i can remove ^^
no dont its not a problem just wasnt sure what it was
um... i dont see anything wrong. try running the code again
i do like 3 times ..
ok
well, you might not be getting an error bcs youre using a bot.event
change it to bot.listen
return nothing
is this in a server?
yes
theres youre problem
add this up at the top:
intents.messages = True
intents.message_content = True
im pretty sure you need those, otherwise the commands will only work in dms
intents.message not a thing but message content ur correct!
yeah sry i forgot the s
okk
you dont need intents.messages
oh
just message content
what intent.message_content do ?
nvm then, just intents.message_content = True
it makes it so the bot can actually read the message
*in servers
yes
i already have that
it automatically can in dms tho which is how i figured that out earlier today
okk
i had this same problem earlier today and it fixed it
i have an error with the token wtf
you probably haven't enabled message content in the developer portal
also the token needs to be passed as a string, yours is outside of quotes im pretty sure
Reinvite your bot if you haven't already and try turning it off, waiting for a bit, and then turning it back on
but the command work
no, like in the bot.run sequence, the token needs to be in quotes
traceback?
the bot is up but i dont receive the on ready
i know why
its ur listen
i change bot.event to bot.listen
put () after listen
any time, u can dm me if you need any more help
aytt
anyways, don't hardcode your help command
recommends to subclass the help command
exactly, but since I have no idea how to do this with a button I'm silent
i just always did it myself
Traceback (most recent call last):
File "c:\Users\Student\Desktop\Developer\Zeus Bot\main.py", line 23, in <module>
bot.load_extension(f"Cogs.{filename[:-3]}")
File "C:\Users\Student\AppData\Local\Programs\Python\Python39\lib\site-packages\nextcord\ext\commands\bot.py", line 802, in load_extension
self._load_from_module_spec(spec, name, extras=extras)
File "C:\Users\Student\AppData\Local\Programs\Python\Python39\lib\site-packages\nextcord\ext\commands\bot.py", line 719, in _load_from_module_spec
raise errors.ExtensionFailed(key, e) from e
nextcord.ext.commands.errors.ExtensionFailed: Extension 'Cogs.changePrefix' raised an error: ClientException: Cog named 'ChangePrefixCog' already loaded
How am I getting this error when I start my bot
Code?
I am doing this with discord.py to load my cogs:
if __name__ == '__main__':
for filename in os.listdir("Cogs"):
if filename.endswith(".py"):
bot.load_extension(f"Cogs.{filename[:-3]}")
you loaded the cog already somewhere
I meant nextcord
Could I do a try-except block then
I'm using disnake for slash commands, and my commands are not appearing in any server, unless I specify a specific one with test_guilds
Yeah they deprecated it but it's honestly a simple fix
Trying to access api data that isn't returned
Is it just a matter of time or I am missing something
and making a failure
@slate swan I am only loading them in my main file
how many times?
1
can see ur main file
import nextcord
import os
import json
from nextcord.ext import commands
from Tools.utils import getGuildPrefix
from Tools.translate import Translate
intents = nextcord.Intents.default()
intents.members = True
bot = commands.Bot(getGuildPrefix, intents = intents)
# HELP
bot.remove_command("help") # To create a personal help command
# Translate
bot.translate = Translate()
# Load cogs
if __name__ == '__main__':
for filename in os.listdir("./Cogs"):
if filename.endswith(".py"):
bot.load_extension(f"Cogs.{filename[:-3]}")
@bot.event
async def on_ready():
print(f'We have logged in as {bot.user}')
print(nextcord.__version__)
await bot.change_presence(activity=nextcord.Activity(type=nextcord.ActivityType.watching, name =f"?help"))
# ------------------------ RUN ------------------------ #
with open("config.json", "r") as config:
data = json.load(config)
token = data["token"]
bot.run(token)
use a try except block then
i mean everytime u tell people stuff they just dont do it like me 🤣

client.load_extension?
So, we’re just gonna skip over the fact he’s changing presence in on_ready? Aight
for player in response["data"]["banlist"]:
if player["name"]:
output_str_a += str(player["name"]) + ", "
embed = nextcord.Embed(title="`Nitrado Obelisk`", description="`🔴` `Banned Gamertag List:`\n" + output_str_a, color=3066993)
await interaction.followup.send(embed=embed, ephemeral=False)
Does anyone know how I would possibly separate or limit this if it exceeds the character limit on Discord?
Use HTTPException
iirc, there’s somethink like as_chunks of whatever as an embed method which does this for you
Got it, will check into that.
Thank you 😄
Yes cause I am changing the status
Don’t do it in on_ready
You can put that in the bot constructor itself
Hm
I do it in the on_ready all the time and it doesn't affect anything
Alot of people so it
do*
If they do that mean you should also do that? Like creative ideas doesn't take place anyone
!d nextcord.ClientException
exception nextcord.ClientException```
Exception that’s raised when an operation in the [`Client`](https://nextcord.readthedocs.io/en/latest/api.html#nextcord.Client "nextcord.Client") fails.
These are usually for exceptions that happened due to user input.
Use this in except part
try:
#ur code
except errorName:
#error handling part
F
Maybe trying to find out why it happens is a better option than handling the error.
Print every extension before you load it
Hm
Ok I did that
But how can I just not load the cogs that are already loaded
It was for it only
Yea
But when I do that
Another file says already loaded
I am just trying to load the files that are not already loaded
"if it works it works"
Mindset that basically is foreshadowing bugs
Screams unmaintainable shit
that means its loaded
just reload
!d discord.ext.commands.Bot.reload_extension
await reload_extension(name, *, package=None)```
Atomically reloads an extension.
This replaces the extension with the same extension, only refreshed. This is equivalent to a [`unload_extension()`](https://discordpy.readthedocs.io/en/latest/ext/commands/api.html#discord.ext.commands.Bot.unload_extension "discord.ext.commands.Bot.unload_extension") followed by a [`load_extension()`](https://discordpy.readthedocs.io/en/latest/ext/commands/api.html#discord.ext.commands.Bot.load_extension "discord.ext.commands.Bot.load_extension") except done in an atomic way. That is, if an operation fails mid-reload then the bot will roll-back to the prior working state.
u need to load it first
@commands.command()
async def reload(self, ctx, arg):
try:
if ctx.author.id == 757508305256972338:
await self.bot.reload_extension(f'commando.{arg}')
await ctx.send(f'**{arg}** is reloaded')
except commands.ExtensionNotLoaded:
await ctx.send(f'**{arg}** is not loaded')
except commands.ExtensionNotFound:
await ctx.send(f'**{arg}** is not found')
@commands.command()
async def load(self, ctx, arg):
try:
if ctx.author.id == 757508305256972338:
await self.bot.load_extension(f'commando.{arg}')
await ctx.send(f'**{arg}** is loaded')
except commands.ExtensionNotFound:
await ctx.send(f'**{arg}** is not found')
except commands.ExtensionAlreadyLoaded:
await ctx.send(f'**{arg}** is already loaded')
``` here is my code if u want some example
hydrorico reading errors😳
Hmmm then it says 1 is already loaded
well you need to load it once
async def main():
async with bot:
[await bot.load_extension(f"commando.{file[:-3]}") for file in os.listdir("commando/") if file.endswith(".py")]
await bot.start(os.getenv('TOKEN'))
asyncio.run(main())
modify it a little urself @frozen patio
Cause some are loaded and some are not
!e print('Bruh')
@clever pulsar :white_check_mark: Your eval job has completed with return code 0.
Bruh
reload should only really be used when the state of the cog changes
that still wont fix it :/
!e a=1+1
print(a)
@clever pulsar :white_check_mark: Your eval job has completed with return code 0.
2
async def main():
async with bot:
[await bot.load_extension(f"commando.{file[:-3]}") for file in os.listdir("commando/") if file.endswith(".py")]
await bot.start(os.getenv('TOKEN'))
asyncio.run(main())
``` @frozen patio
#bot-commands
bruh
dude
what
wtf is wrong with this kid
You?
why flood chat?
forget it do what u want
...
async def main():
async with bot:
[await bot.load_extension(f"commando.{file[:-3]}") for file in os.listdir("commando/") if file.endswith(".py")]
await bot.start(os.getenv('TOKEN'))
asyncio.run(main())
Yeah I know, I just don't understand why they are loading when I never load them anywhere else
This is the first time I have ever seen this
just do this
😭
Bruh
and change commando to ur own folder name
take it or leave it
that will load all the extension
But some are loaded
is all the cogs in one folder
Right here is the initial error
Yeah there is the cogs folder and the tools folder
then u need to load both of those
🤦
that means u are loading them wrongly?
show me the error
btw this thing works for u?
await bot.start(os.getenv('TOKEN'))
u need to modify this urself since u are not using replit
Traceback (most recent call last):
File "C:\Users\Student\AppData\Local\Programs\Python\Python39\lib\site-packages\nextcord\ext\commands\bot.py", line 714, in _load_from_module_spec
setup(self, **extras)
File "c:\Users\Student\Desktop\Developer\Zeus Bot\Cogs\changePrefix.py", line 34, in setup
bot.add_cog(ChangePrefixCog(bot))
File "C:\Users\Student\AppData\Local\Programs\Python\Python39\lib\site-packages\nextcord\ext\commands\bot.py", line 554, in add_cog
raise nextcord.ClientException(f"Cog named {cog_name!r} already loaded")
nextcord.errors.ClientException: Cog named 'ChangePrefixCog' already loaded
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "c:\Users\Student\Desktop\Developer\Zeus Bot\main.py", line 27, in <module>
bot.load_extension(f"Cogs.{fn[:-3]}")
File "C:\Users\Student\AppData\Local\Programs\Python\Python39\lib\site-packages\nextcord\ext\commands\bot.py", line 802, in load_extension
self._load_from_module_spec(spec, name, extras=extras)
File "C:\Users\Student\AppData\Local\Programs\Python\Python39\lib\site-packages\nextcord\ext\commands\bot.py", line 719, in _load_from_module_spec
raise errors.ExtensionFailed(key, e) from e
nextcord.ext.commands.errors.ExtensionFailed: Extension 'Cogs.changePrefix' raised an error: ClientException: Cog named 'ChangePrefixCog' already loaded
show ur code
How much of it
I have like 17-20 cogs
But this is my main:
import nextcord
import os
import json
from nextcord.ext import commands
from Tools.utils import getGuildPrefix
from Tools.translate import Translate
intents = nextcord.Intents.default()
intents.members = True
bot = commands.Bot(getGuildPrefix, intents = intents)
# HELP
bot.remove_command("help") # To create a personal help command
# Translate
bot.translate = Translate()
for fn in os.listdir("./Cogs"):
if fn.endswith(".py"):
bot.load_extension(f"Cogs.{fn[:-3]}")
@bot.event
async def on_ready():
print(f'We have logged in as {bot.user}')
print(nextcord.__version__)
await bot.change_presence(activity=nextcord.Activity(type=nextcord.ActivityType.watching, name =f"?help"))
# ------------------------ RUN ------------------------ #
with open("config.json", "r") as config:
data = json.load(config)
token = data["token"]
bot.run(token)
...
What
async def main():
async with bot:
[await bot.load_extension(f"commando.{file[:-3]}") for file in os.listdir("commando/") if file.endswith(".py")]
await bot.start(os.getenv('TOKEN'))
asyncio.run(main())
```copy pasta this
jesus christ
for fn in os.listdir("./Cogs"):
if fn.endswith(".py"):
bot.load_extension(f"Cogs.{fn[:-3]}")
```replace this
import it :/
He’s using nextcord
oo
no idea
It won’t
I’m not sure what’s wrong with ur code
I am not either...
You should store your token in .env files and can I see your cog loading process ?
import nextcord
import json
from nextcord.ext import commands
from Tools.utils import getConfig, updateConfig
# ------------------------ COGS ------------------------ #
class ChangePrefixCog(commands.Cog):
def __init__(self, bot):
self.bot = bot
# ------------------------------------------------------ #
@commands.command(name = 'changeprefix',
aliases= ["prefix"],
usage="<newPrefix>",
description="Change the bot's prefix.")
@commands.has_permissions(administrator = True)
@commands.cooldown(1, 3, commands.BucketType.member)
@commands.guild_only()
async def changeprefix(self, ctx, prefix):
data = getConfig(ctx.guild.id)
data["prefix"] = prefix
await ctx.channel.send(self.bot.translate.msg(ctx.guild.id, "changeprefix", "NEW_PREFIX").format(prefix))
updateConfig(ctx.guild.id, data)
# ------------------------ BOT ------------------------ #
def setup(bot):
bot.add_cog(ChangePrefixCog(bot))
@torn sail This is the cog that supposedly is already loaded
@stone beacon this
The other cogs are loading?
Disable it rq and see if your other cogs load
Wack
Ikr
You're probably loading the cogs somewhere else first?
O0
I'm actually stumped
Unless nextcord had some update that corelates to how cogs are loaded in d.py
I haven't updated nextcord in a bit
This assumes that the module name always ends with .py
...

disnake.ext.commands.errors.ExtensionFailed: Extension 'cogs.events' raised an error: ExtensionFailed: Extension 'cogs.youtube' raised an error: ModuleNotFoundError: No module named 'discord'
my code
import disnake
from disnake.ext import commands
from cogs.listvar import scritch
import json
from youtube_transcript_api import YouTubeTranscriptApi
def setup(bot):
bot.add_cog(youtube(bot))
class youtube(commands.Cog):
"""A couple of simple commands."""
def __init__(self, bot: commands.Bot):
self.bot = bot
@commands.command(name='search')
async def search(self, VID, keyword):
transcript = YouTubeTranscriptApi.get_transcript(VID)
print(transcript)
JsonItem = str(YouTubeTranscriptApi.get_transcript(VID))
keyval = keyword
check = json.loads(JsonItem)
if keyval in check:
print("%s is found in JSON data" %keyval)
YES
You have a youtube cog in your cog.events file? Are you sure you're looking at the correct file?
It seems like you're using Disnake instead of Discord.py, which means you should change any import discord to import disnake
omg... ima check that code rq
Oo
What was wrong with your utils folder that affected your cogs folder?
I forced a replace for discord to disnake in all files and it fixed it. idk where it was wrong tho lol
how to auto-reconnect the bot if there is wifi outage ?
Hi. I wanted to build a simple Discord Bot for fun. I want to add simple games to it (single or 2 players). Does anyone have any game ideas?
Connect 4 seems like a fun thing to implement
Hmmm thanks
Also, just wanted your opinion... If there was a bot with fun quizzes and good questions which gives you interesting rewards if you answer correctly, would you use such a bot?
Personally no, but there might be others interested in that
TTT
Ok cool
need help w my bot
import hikari
import lightbulb
import requests
from bs4 import BeautifulSoup
import re
url = "https://gfuel.com/collections/on-sale"
result = requests.get(url)
doc = BeautifulSoup(result.text, "html.parser")
sale = doc.find_all('div', class_="product_info")
price = doc.find_all('span', class_="money")
print(doc.find('div', class_='banner_caption').text)
for item in sale:
saleitems = item.b.text
opentoken = open('token.txt', 'r')
def TOKEN():
for line in opentoken:
print(line, end="")
print(TOKEN())
def Gfuelbot():
bot = lightbulb.BotApp(token=f'(TOKEN)',
default_enabled_guilds=(GUILD)
)
@bot.listen(hikari.GuildMessageCreateEvent)
async def print_message(event):
print(event.content)
@bot.command
@lightbulb.command('sale', 'Prints The Available Tubs')
@lightbulb.implements(lightbulb.SlashCommand)
async def ping(ctx):
await ctx.respond(f'{saleitems}')
bot.run()
Gfuelbot()
when i run /sale it only outputs Ghost Gaming Starter Kit why?
oh ok
importance matters, and I surely dont have any
idk if I'll be actually around here anymore
huh
where are u going ;-;
@discord.ui.button(style=discord.ButtonStyle.green, label="=", row=3)
async def equal(self,interaction: Interaction, button: Button):
try:
self.expr = await self.calculate(self.expr)
except:
return await interaction.response.send_message("Um, looks like you provided a wrong expression....")
await interaction.message.edit(content=f"```\n{self.expr}\n```")
``` how can i calculate the expression?
error:
more like frustrated of getting ignored every time
calculate isnt a method....
btw u know how to do raise error in a try except?
raise
try:
...
except Exception as var:
raise var```
try:
#blahblah
except NameError:
#blahblah
else:
raise error
```something like this
cathing an error and then raising it?
idk why

huh? use finally instead
lmao there is such a thing 🤣
it would always raise the error lmao
it should, shouldnt it uhh nvm, im done
jesus christ
just dont handle it
how
!d yield
7.7. The yield statement
yield_stmt ::= yield_expression
``` A [`yield`](https://docs.python.org/3/reference/simple_stmts.html#yield) statement is semantically equivalent to a [yield expression](https://docs.python.org/3/reference/expressions.html#yieldexpr). The yield statement can be used to omit the parentheses that would otherwise be required in the equivalent yield expression statement. For example, the yield statements
```py
yield <expr>
yield from <expr>
``` are equivalent to the yield expression statements...
does finally always get triggered after the try and except?
used with iterators/generators
try:
#blah
except NameError:
#blah
```if i do this unboundlocal error will not be raised
it does
well them i am correct
what does nonlocal do never heard of it
it uses a var thats not in the local scope its mostly used with nested functions
oh i see
kinda scoping error that i always get awhile back then
Yield assert nonlocal
assert is used to check if a condition is true if not it raises an AssertionError
!e
assert 1==1
@slate swan :warning: Your eval job has completed with return code 0.
[No output]
@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 | AssertionError
its quite helpful
if false statement then raise error?
if the condition is false that is so
Oh it raise error
@slate swan
def myfunc1():
x = "John"
def myfunc2():
nonlocal x
x = "hello"
myfunc2()
return x
print(myfunc1())
an example! of the usage of the keyword
» empty-json
» except
» environments
» enumerate
» exit()
» for-else
!e
def myfunc1():
x = "John"
def myfunc2():
nonlocal x
x = "hello"
myfunc2()
return x
print(myfunc1())
@loud junco :white_check_mark: Your eval job has completed with return code 0.
hello
ohhh, wait, so does it overwrite the value too?
what is nonlocal x
its not a method
yep
create a calculate method first, it has to be a custom one
mhmm k
weird
🙂
!e
true_condition = 1 == 1
false_condition = 1 == 2
print(bool(true_condition), bool(false_condition))
assert true_condition
assert false_condition
@slate swan
@commands.command()
@commands.has_permissions(administrator=True)
async def warn(self, ctx, user:nextcord.Member, reason):
try:
await user.send(f'You have received a warning from the Server: \n{reason}')
await ctx.send("Done.")
except Exception:
await ctx.send("Failed to DM the user, oh well.")
when i warn someone, it only sends the first word of the reason. does anyone know how to fix it?
ex: the reason is "test warning," the bot will only send "test"
@slate swan :x: Your eval job has completed with return code 1.
001 | True False
002 | Traceback (most recent call last):
003 | File "<string>", line 5, in <module>
004 | AssertionError
pretty handy imo
let foo = "uwu";
{
foo = "okimii uwu";
console.log(foo); //okimii uwu
}
console.log(foo) // uwu
I love js 😔
whats the let keyword for? variable creation?
add a * before reason is in the function
oh like * in the parameters?
yeah, its quite helpful in case of those types of problems
declaring in js is very long
const let and var 💀
not long
but are pepo still using var?
again, its quite useful
seems weird to me
thank you, that fixed it!
function uwuuwuwu(){
var uwu = "okimii";
}
console.log(uwu);
then again this is completely valid
are you printing the variable or the function i cant tell
my bad
okimii become my linter 😔
so no local and global scopes?
yeah
ill scream at you
😔
though if you already have the variable declared, it'll limit the value of the variable if it was declared within the function to the function only
pls dont talk to me about js it makes me wanna through my bread out of my window
tf is this
let uwu = "okimii";
function yes(){
uwu = "Sift";
console.log(uwu); //Sift
}
console.log(uwu); //okimii```
so keywords changes scopes or what im so confused🗿
lmao everybody getting a stroke at js, I hate ya'll
js's syntax makes me wanna learn assembly
eh, only the scoping is a bit tricky
and finding errors if you get any
let and var like it makes me wanna kick a wall with my little toe
which can be a headache if you don't manually run your program after every 15 lines
kick me instead uwu
ill go to jail for assault
so no
its fine, I wont report you
no thank you
feeble okimii
i dont hurt females in general
general
pls dont
okay ig we are way off sanity, lets wrap ths up
smack the ot on me pls
bro
!rule 7
7. Keep discussions relevant to the channel topic. Each channel's description tells you the topic.
u hurt them under ur basement
jokes on you i dont have a basement
🤣
btw how do i reduce rate limited though, idk how to reduce the api usage per second(idk what is it called)
sleep on each request and/or dont make unnecessary api calls
what is api calls
a call to the api
like using the thing from import discord?
with a request
e.g sending a message you would need to make an api call/request to send the message to the api
just check the ratelimit on the endpoint
i read that
and i understand nothing
well did you actually read it or did you only read the first sentence?
no, the syntax was wrong lol
i read the whole page
you sure?
yes
Integrate your service with Discord — whether it's a bot or a game or whatever your wildest imagination can come up with.
i dont know what is http method
😵💫
Google it, it's how most of the web works
idk wht im writjg i neef sleep rn
writing nref
writing*, need*
goodnight 🤣
imagine sleeping
just correct it whatever was wrong, am too lazy to read it and edit it
u can trust me :D
same
😳
i asked u
🤔
i asked u and u nvr answer me ;-;
👀
so which one do u want :D
Wott is colorama and traceback
Modules
@loud junco what's the issue?
Colorama is for colored output, traceback is for working with traceback (logic)
Ok
Colorama is external, traceback is builtin
What is init and its use
Object initialization
Oo
I suggest reading about OOP in python
how to make the bot autoconnect when network outage ?
Yr lib already does that
Afaik library automatically reconnects
okok
error undefined
idk how to define it
Show the traceback?
uh thats just me finding bugs and occasionally causing them to go offline
Ah okay.
How to configure slash command options in disnake?
Do you mean options or choices? because you declare options as the parameter of the command
Options. Like /test option1
In discord2, I had to do
option1: Option(name = ...)
Does not work with disnake tho'. Gives an unhashable error. I can use options = List[Option] in @bot.slash_command(here) but I don't really want to use that.
Yup there was something to declare options with that but now it is deprecated, options are passed as parameters
@bot.slash_commands()
async def my_command(my_parameter: str):
...
there you have an option of string type
What if I have to add description to those options?
Those types are supported, others must be converted implicity, like a basic converter
using docstrings
Ohh
Thanks mate :)
@placid skiff What if I have to change things like required = False and stuff?
So as you do in normal commands, required parameters must be declared before the optional parameters, you declare the optional by assing them a default value of None
@bot.slash_commands()
async def my_command(my_str: str, my_num: int = None):
...
https://docs.disnake.dev/en/latest/ext/commands/slash_commands.html?highlight=slash commands
Check this page whenever you have some trouble
Ahh yes, should have thought of = None. Sorry for the trouble and thanks again!
just add this "`" to open and close a string
Sometimes I wonder what if two IDs are of the same value.
try with a triple quote string
in pycord after using interaction.response.defer() i get a leftover response to the command from my bot that says 'The application did not respond' but i know everything has finished after i clicked my button because i have an embed sent out. how would i go about removing this reply message?
my_string = """this is
a multiline
string
"""
im using nextcord and working on slash commands
recently i made a cog and added a slash command (hi) to it...
but its not showing up in the slash commands...
have no errors in console
slash commands takes up to 1 hour to be registered globally
ya and i thought that
so what i did was created a normal command named test under same folder
still didnt work...
Uh then you have some problems with the cog, or the bot
can't know without an inspection
No DM sorry, ask here more people could help
also is it possible for when using a slash command, have arguments in a drop down menu?
for fn in os.listdir('./cogs'):
if fn.endswith('.py'):
client.load_extension(f"cogs.{fn[:-3]}")
@client.command
async def load(ctx, extension):
client.load_extension(f"cogs.{extension}")
await ctx.send(f"Enabled {extension}")
@client.command
async def unload(ctx, extension):
client.unload_extension(f"cogs.{extension}")
await ctx.send(f"Disabled {extension}")
@client.command
async def reload(ctx, extension):
client.reload_extension(f"cogs.{extension}")
await ctx.send(f"Reloaded {extension}")
.
.
that seems fine
slash command (hi)
import nextcord
from nextcord.ext import commands
from nextcord import Interaction
class hi(commands.Cog):
def __init__(self, client):
self.client = client
@nextcord.slash_command(name = "vhi", description ="replies with hello")
async def hey(self, interaction: Interaction):
await interaction.response.send_message("hi", ephemeral=True)
def setup(client):
client.add_cog(hi(client))
@placid skiff any probs in this?
seems not
um.. but why doesnt it show up
where is the normal command?
import nextcord
from nextcord.ext import commands
class test(commands.Cog):
def __init__(self, client):
self.client = client
@commands.command()
async def test(self, ctx):
await ctx.send("Working...")
def setup(client):
client.add_cog(test(client))
normal one..
same way, embed values are strings
do you have some event?
uhm...like?
@client.event something like that
what event?
on_ready
do you have a print function in it?
ya..
does it shows up?
ofc
@client.event
async def on_ready():
print("'Volter' is up and running perfectly... ")
where is the main?
Yeah
uhm..so whats the error here
Dunno, all seems fine
you can try to setup your bot following this repo https://github.com/Tvrsier/BaseBot
Base bot setup for discord.py and relative forks. Contribute to Tvrsier/BaseBot development by creating an account on GitHub.
mhm...
and check if it works with that
ok ty
you can even download it then you will have only to change disnake to nextcord, do as you lke
hm...
i will just try once more like saving all my slash commands first in another file which i made in the main file.. then try your bot/repo
hey there, how do I send interactive buttons along with a message using discord.ui.Button
it could be
ok...
u could get rate limited
look at the dpy latest docs
Sure
@bot.slash_command(description = "Change teams for user")
@commands.has_role("Captain")
async def team(ctx, player: discord.User, team: str, tmz: str):
class View(discord.ui.View):
@discord.ui.button(label="Deny", row = 1, style=discord.ButtonStyle.red)
async def button_callback(self, button, interaction):
guild = bot.get_guild(GUILDID)
role = guild.get_member(interaction.user.id).get_role(ROLEID)
if role is None:
await interaction.response.send_message(f"<@{interaction.user.id}>, you don't have perms to interact", ephemeral=True)
else:
# buncha stuff
@discord.ui.button(label="Approve", row = 1, style=discord.ButtonStyle.green)
async def button_callback(self, button, interaction):
guild = bot.get_guild(GUILDID)
role = guild.get_member(interaction.user.id).get_role(ROLEID)
if role is None:
await interaction.response.send_message(f"<@{interaction.user.id}>, you don't have perms to interact", ephemeral=True)
else:
# buncha stuff
embed = discord.Embed(title = "Transaction Request", description = f'<@{ctx.author.id}> requests <@{player.id}> to {team} with timezone {tmz}.')
await ctx.send(embed=embed, view=View(timeout=None))
maybe my format for the command is not good since i have class inside of the function, but idk how to refer to function argument inside of class, but regarding multiple buttons, with this command right now only the 2nd button gets displayed
removing row also results in same thing
because the function names of both buttons are same, change one of them
doesn't type kwarg in a command option not try to convert in a slash command?
Ah you mean button call back
it does, what type did you provide?
yessir
I did not realize while writing, thank you!
@lightbulb.option(
'channel',
'...',
TextableGuildChannel,
default=None,
required=False
)
and i get 'hikari.interactions.command_interactions.InteractionChannel', i can't send message to that channel then
you don't actually need to use Channel.send, RESTClient in hikari is very usable ```py
await bot.rest.create_message(channel.id, **kwargs you use in .send)
ah ok, ill give it a try
How to add reaction in disnake?
I tried
MSG = await inter.response.send_message(embed = emb)
await MSG.add_reaction(...)
``` and this did not work.
because its interaction responses aren't messages
Then how do I?
Should I instead to inter.reply or inter.send?
await inter.response.send_message(....)
msg = await inter.original_message()
await msg.add_reaction(...)
oH. I see.
By the way mate, what do you call those responses which are only visible to the author? @slate swan
ephemeral response
How do you create those?
!d disnake.InteractionResponse.send_message the ephemeral keyword
await send_message(content=None, *, embed=..., embeds=..., file=..., files=..., allowed_mentions=..., view=..., components=..., tts=False, ephemeral=False, suppress_embeds=False, delete_after=...)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).
Responds to this interaction by sending a message.
who're you-
How does discord.py keep the cached objects in sync with changes?
they most probably update the cache with events internally
Yes
How can i get label of a button from an interaction ?
so?
I am you except the "Ashley ".
Can you tell me about the Discord robot with Python? I want to join Bot in voice Join
I'm still clueless
!d discord.VoiceChannel.connect
await connect(*, timeout=60.0, reconnect=True, cls=<class 'discord.voice_client.VoiceClient'>, self_deaf=False, self_mute=False)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).
Connects to voice and creates a [`VoiceClient`](https://discordpy.readthedocs.io/en/latest/api.html#discord.VoiceClient "discord.VoiceClient") to establish your connection to the voice server.
This requires [`voice_states`](https://discordpy.readthedocs.io/en/latest/api.html#discord.Intents.voice_states "discord.Intents.voice_states").
tnx

meh being cute

اینجا فارسی زبون داری؟

im in persian
!rule 4
4. Use English to the best of your ability. Be polite if someone speaks English imperfectly.
and you?
!rule 7
7. Keep discussions relevant to the channel topic. Each channel's description tells you the topic.
ok sorry
it was always meant to be
!ot pls
Off-topic channel: #ot2-never-nester’s-nightmare
Please read our off-topic etiquette before participating in conversations.
bruh we're telling people to go ot yet talk about the name of the ot channel
It's a self bot
lmao
bruh
what
dont ping me
!rule 4
4. Use English to the best of your ability. Be polite if someone speaks English imperfectly.
Mm
what
ok ? @fiery sphinx
Stop being so self-centered, you aren't, I obviously am smh
oof... sorry ig
that's a damn good name
@!#(%!@)~@!%
"/
but you pinged me again
@fiery sphinx @tepid sundial Go to DMs/off-topic channels please
Ok
there's no mod that's usually here
there are
?
i want a source for bot get dc a user in voice
brad is
yeah
could you please elaborate wym
me too
to disconnect someone?
you use await member.move_to(None)
!d discord.Member.move_to
await move_to(channel, *, reason=None)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).
Moves a member to a new voice channel (they must be connected first).
You must have the [`move_members`](https://discordpy.readthedocs.io/en/latest/api.html#discord.Permissions.move_members "discord.Permissions.move_members") permission to use this.
This raises the same exceptions as [`edit()`](https://discordpy.readthedocs.io/en/latest/api.html#discord.Member.edit "discord.Member.edit").
Changed in version 1.1: Can now pass `None` to kick a member from voice.
TNX
Most of them listen to modmail/auto triggers
Nice
you want to hide all commands with no category? or the help command specifically?
Just check if Category is No Category
just the help command
whats your current code?
could i just remove this part of the code right?
cogname = getattr(cog, "qualified_name", "No Category")
where it says No Category
Why u doing that...?
No Category is used when the cog doesn't have a qualified_name attribute/property so no
its from some tutorial i believe? the interstella0 gist
Decent help command.. but I made a better one a couple months later
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.
Show your help command subclass
my help command just asks to type / and see it urself kek
U can simply say it's a slash command
i do this for my discord.js bot
i switched to slash commands because I don't want to go through the pain of writing a help command
cant you make a dynamic one easily
Some bots use slash commands completely but still have a help command kek
like getting all the slash command objects thru the rest or cacheing it and making the help command with it
took me a while lol
Make the class's initializer and add this inside it
super().__init__(
command_attrs={'hidden': True}
)
This will hide the help command. It's like doing ```py
command = bot.get_command('star-me')
command.hidden = True
isnt it meant for hiding commands from a cog tho
Yeah
It will filter the hidden commands too
Lol. My nickname is V and I am stranger to you. Don't think about it much.
random bullshit go
Nice, ot talks
anyone know how to check encoding of text in txt files or any lib that does so
Check encoding as in?
SHA Hash or what?
i have some text files i use for translation now they are encoded in accordance to their language sometimes so i need a auto encoding detector
https://en.wikipedia.org/wiki/Windows_code_page
Windows code pages are sets of characters or code pages (known as character encodings in other operating systems) used in Microsoft Windows from the 1980s and 1990s. Windows code pages were gradually superseded when Unicode was implemented in Windows, although they are still supported both within Windows and other platforms, and still apply when...
lemme see thx
Ain't all of them UTF-8 encoded?
unfortunately not
I mean, u can still use open() and use the string directly, no?
no it gives me a charmap cant decode byte
and even if i read the bytes as string i cant imagine what translation i will get
._.
oof google api sucks sometimes
thx it worked
it didnt use cp tho it just like gave utf-16 ig some text files can be opened with multiple encodings
how did ur exam go aced it?
hunter intrested in multithreading api calls?
kinda, missed by 5 marks
ooh nice
Huh?
calculus?
hmm i was working on an autotranslator so i kinda get like arnd 20000 approx characters translated per second wanna make it faster but not sure how to
Use multiprocessing? But idk how u gonna share data between threads
Since iirc threads don't share data directly
!d concurrent.futures
New in version 3.2.
Source code: Lib/concurrent/futures/thread.py and Lib/concurrent/futures/process.py
The concurrent.futures module provides a high-level interface for asynchronously executing callables.
The asynchronous execution can be performed with threads, using ThreadPoolExecutor, or separate processes, using ProcessPoolExecutor. Both implement the same interface, which is defined by the abstract Executor class.
i take the returned result and add it in a dict
google dont take more than 2000 characters at a time
its just a standalone translator
but i am doing that rn i create a processpoolexecutor and create threads tho i never really under stood where to use thread pool executor and where process
That's sad. I never got into that deep lol
Cool then
welp chardet got a few wrong guess i have to add a few try except blocks
Can someone help with heroku?
ask
Nice, GGs!
Sure, ig
ÊéÃû£ºÈ«ÇòÉñµoʱ´ú ×÷ÕߣºÒ»Ï¦³ÉµÀ
ÁÖÏö´©Ô½µ½Ò»¸öÈ«Ãñ³ÉÉñµÄ³¬Ææ»Ã³¬¿Æ»Ãʱ´ú¡£
´ÓÒ»¸öÉñÐÔÉúÎïÆðʼ£¬½¨Á¢ÉñÓò£¬¾Óª¾ì×åÐÅͽ£¬µãȼÉñ»ð£¬Äý¾ÛÉñ¸ñ£¬Õ÷Õ½ÍâÓò£¬¶áÈ¡Éñ¸ñ¡£
what is this? 👀
Asher's plan of becoming a Helper
👀 nice
Urghhhh
looks more like secret nuclear codes
are u stuck some where?
Ofc lol
where?
I want to write the logging output to a log file and I have added a FileHandler... But now how tf do I prevent it from writing to stdout and stderr (same for errors)
u could just put that in an except block for error handling
u are using subprocess for stdout and err?
@maiden fable have you set propagate to False?
If this attribute evaluates to true, events logged to this logger will be passed to the handlers of higher level (ancestor) loggers, in addition to any handlers attached to this logger. Messages are passed directly to the ancestor loggers’ handlers - neither the level nor filters of the ancestor loggers in question are considered.
If this evaluates to false, logging messages are not passed to the handlers of ancestor loggers.
Spelling it out with an example: If the propagate attribute of the logger named A.B.C evaluates to true, any event logged to A.B.C via a method call such as logging.getLogger('A.B.C').error(...) will [subject to passing that logger’s level and filter settings] be passed in turn to any handlers attached to loggers named A.B, A and the root logger, after first being passed to any handlers attached to A.B.C. If any logger in the chain A.B.C, A.B, A has its propagate attribute set to false, then that is the last logger whose handlers are offered the event to handle, and propagation stops at that point.
The constructor sets this attribute to True
Try having a lower level for the file handler and a higher level for the console
What's that? Sorry, never used logging module much 😅
hey
That's what I have done. I did getLogger().addHandler(FileHandler(log_file))
how can i ping a role with a discord bot | pls ping me if you can help
You can set propagate value to False then pass your own stream handler into the logger
role.mention
But what level is it set to? Debug, info, error, warn etc
Actually it's a discord bot along with which I'm hosting a FastAPI instance. Now, the FastAPI logger does this thing. I have also tried to change sys.stdout and sys.stderr but no luck
So when propagate is set to False, it doesn't send the output to stdout?
pls help 😁
Yeah it shouldn't
Also alternatively iirc you can redirect stdout with contextlib
If you need a role object, get the role object then you can use .mention attribute to make the bot mention it
or if you have it's id you can just <@&id>
But where to put the ctxlib.redirect_stdout? The FastAPI app has to be manually ran via a cli command
So there's no app.run() or smth 😔
e.set_thumbnail(url=member.avatar.url)
AttributeError: 'str' object has no attribute url
did this change?
Im not using 2.0
use the contextmanager version and put the logging stuff under that.
github copilot
there are multiple other autocompleting software
i dont use any, but there some good ones, kite, tabnine, github copilot (u have to sign up on their website and wait for months to get this, but its probably the most advanced one right now) intellij, etc
hello, im trying to make a command which gets a user's badges... this is custom badges, not hypesquad etc... this is my code: ```py
async def get_member_badges(self, member):
user = self.bot.get_user(member.id)
guild = self.bot.get_guild(764049436275114004)
staff_role = guild.get_role(849669358316683284)
partner_role = guild.get_role(972071921791410188)
booster_role = guild.get_role(782258520791449600)
contrib_role = guild.get_role(950785470286163988)
if user.id == self.bot.owner.id:
return ":developer: Developer"
if staff_role in user:
return ":staff: Staff Member in the support server"
if partner_role in user:
return ":partner: PizzaHat's Partner"
if booster_role in user:
return ":booster: Booster in the support server"
if contrib_role in user:
return ":github: Contributor of PizzaHat"
else:
return f"{self.bot.no} N/A"
@commands.command()
@commands.cooldown(1, 3, commands.BucketType.user)
async def badges(self, ctx, member: discord.Member=None):
"""
Shows different badges of a user.
If no user is given, return your badges
"""
if member is None:
member = ctx.author
badges_list = await self.get_member_badges(member)
em = discord.Embed(
title="User Badges",
color=self.bot.color
)
em.set_author(name=member, icon_url=member.avatar.url)
em.description = badges_list
await ctx.send(embed=em)
this works, but not as expected.. i want it to show every badge the user has in a new line.. but it only shows one..
example: since im the dev of the bot it only shows developer, but im also a staff member having that role.. how do i do that? i think something's wrong with my ifstatements
kite
its not as much as developed as copilot, but kinda helpful
i've used github copilot.... and its kinda annoying
That's now how it works
can anyone help pls?
U need to return a list, not single element
so return ["things here"]
Inside the if statements, append to a list and return the list at last
can u show me an example
i got the list part.. but didnt get what u mean by append and return at last
like this? ```py
async def get_member_badges(self, member):
user = self.bot.get_user(member.id)
guild = self.bot.get_guild(764049436275114004)
staff_role = guild.get_role(849669358316683284)
partner_role = guild.get_role(972071921791410188)
booster_role = guild.get_role(782258520791449600)
contrib_role = guild.get_role(950785470286163988)
if user.id == self.bot.owner.id:
dev = [":developer: Developer"]
if staff_role in user:
staff = [":staff: Staff Member in the support server"]
if partner_role in user:
partner = [":partner: PizzaHat's Partner"]
if booster_role in user:
booster = [":booster: Booster in the support server"]
if contrib_role in user:
contrib = [":github: Contributor of PizzaHat"]
else:
return f"{self.bot.no} N/A"
return [dev, staff, partner, booster, contrib]
async def func(...):
badges = []
if ...:
badges.append("Dev")
if ...:
badges.append("Staff")
return badges
Got it? @dense swallow
you are interested in using the in on user.roles instead of user itself
actually no, you can directly use member.roles, too much of useless code there
so like: if role in user.roles
instead of: if role in user
yep.
but that wont work,since user there needs to be a discord.Member, and you have a User
.
Dear, how to display in the chat not the author, but the user of which I will ping in the command !command @echo breach#0000
url = str(ctx.author.avatar_url)[:-10]
so that instead of the author there was another
???
Wdym?
?
What do you mean
I want that when I enter the command, not my avatar is displayed, but another user whose ping
how to check if user has nitro?
u must be using author avatar?
If u use ctx.author.avatar_url
!d discord.Guild.premium_subscribers
property premium_subscribers```
A list of members who have “boosted” this guild.
It will do whoever did the cmd
not all just for userinfo
oh wait u want the list of users who has nitro?
not the author. and another user. this is for the ban team
nah like if i use ui then it show that i have nitro or not
and how to specify the URL of another user and not the author?
just show the code
^
Can someone tell me why bot is not defined? I normally do commands like @commands.command()
Hey @slate swan!
You either uploaded a .txt file or entered a message that was too long. Please use our paste bin instead.
bot.event() is not a thing
!d discord.PublicUserFlags
class discord.PublicUserFlags```
Wraps up the Discord User Public flags.
wait how do I do an event for on message
u using cog?
yes
@bot.event
@commands.has_role(982744620792426537)
@commands.command(name = "бан", aliases = ["забанить", "ban"])
async def command_clear(self, ctx, *, member: discord.Member, reason = None):
try:
await ctx.channel.purge(limit = 1)
# await member.ban(reason=reason)
img = Image.open("./ImageO/ban/фон.png") # открыл картинку с фоном
url = str(ctx.author.avatar_url)[:-10] # создал переменную URL аватарки моей -10 символов с конца
url1 = requests.get(url, stream = True) # Сделал юрл более оптимизированным
url1 = Image.open(io.BytesIO(url1.content))
url1 = url1.convert('RGBA') # конфертировал аву в РГБА
url1 = url1.resize((1850, 1850), Image.ANTIALIAS) # Изменил ширину и высоту авы
url1M = Image.new('L', url1.size, 0 ) # Создал картинку. Где L означает черно белая для маски нужна. url1.size перенимает size. 0 прозрачность
idrawM = ImageDraw.Draw(url1M) # говорим что переменной idrawM будем рисовать чтонибуить на url1M
idrawM.ellipse((0, 90, 1850, 1800), fill=255) # Рисуем элипс. координаты 0 с права, 90 с верху, 1850 ширина, 1800 высота. 225 непрозрачная
img1 = Image.open("./ImageO/ban/Рамка1.png") # открыл рамку
img1M = Image.open("./ImageO/ban/РамкаМ.png").convert('L') # открыл маску для рамки. конвертировал в чернобелую картинку
img.paste(url1, (2575, 730), url1M) # соеденил img и url1. координаты url1 2575 справа и 730 с верху. наложил на url1 маску (url1M)
img.paste(img1, (0,0), img1M) # соеденил img и img1 с координатами 0 справап и 0 сверху. наложил на img1 маску (img1M)
img.save('./ImageS/user_card.png') # сохранил картинку
await ctx.send(file=file1, embed=embed)
os.remove("./ImageS/user_card.png
bot still not defined
@commands.Cog.listener()```
if in cogs: @commands.Cog.listener()
oh sheet i forgot about all of that, thanks
@granite parcel I slightly shortened the code because it was not sent
member.avatar_url
member.avatar_url
url = str(ctx.member.avatar_url)[:-10] # создал переменную URL аватарки моей -10 символов с конца
Not ctx
Just member.avatar_url
what version of dpy is that?
1.7.3 i think
premium?
ctx.author
oh god
They need member.avatar_url for what they are doing
i believe you dont need to use requests to get the bytes, discord.py has inbuilt methods for that which im unable to recall for 1.7.3
so ctx.author.avatar_url?
Nah
url = str(member.avatar_url)[:-10] # создал переменную URL аватарки моей -10 символов с конца
🥺
Probably has to do with the splicing at the end there
but why str?
I do not know. how is it necessary?
TypeError: on_message() missing 1 required positional argument: 'message' Can someone tell me why this is happening?
is that inside the class?
yes
!paste can u send ur code
Oh. I figured it out. Thank you dear
alright
you cant have ctx in events 
ctx is not an argument
On message doesn’t take ctx
help god
@commands.Cog.listener()
async def on_message(self, ctx, message):
if '' or '' or '' or '' in message.content:
await message.delete()
message_redo = message.replace('e', '3').replace('a', '4')
await ctx.send(message_redo)```
😔 why are people so obsessed with ctx, they dont even spell it right, its context
ctx is shorten for it
probably because commands use context
yeah, still, you wont be using it in on_command events
its just message lol
I don’t understand that first if statement lmao
can i send messages on an event?
yes
message.channel.send or make a channel object and send
Probably can’t in the on connect one
why not, the message provides you most of the things context does
await message.send like dis?
Since ctx is just a shortcut binding to many message attributes anyway
u send messages in a channel....
like u are using message as argument so you have to use await message.channel.send
i don't have to specify the channel?
u have to add a channel like message.channel.send()
@scarlet aurora
or ctx for short in most cases
alr
what event
on_message



