#discord-bots
1 messages · Page 670 of 1
trying to not send memes here
@slate swan you fine?
Same
lol
everybody did, you aren't blessed
no 
I am already blessed enough, no need for more blessings ngl
i am blessed
why the heck everybody takes the meaning wrong ,-,
Lmao it was just a joke
new lyrics for my up and coming rap song
Kira please ask a question make this less awkward 🥺
!ot
i am blessed yuh,
u aint blessed yuh,
i am blessed yuh,
u aint blessed yuh,
i am blessed yuh,
u aint blessed yuh,
i am blessed yuh,
u aint blessed yuh,
i am blessed yuh,
u aint blessed yuh,
😐
ngl it became a shit posting channel
Yea

Anyways I have a question...
question away
My button shows Interaction Failed even after sending the message
can you set an embed field under the image
No iirc
that means the button is not working
thank me later
guys what other decorators can you use other than discord.ui.button in a subclass of discord.ui.View
Interaction was never responded to
💀
discord.ui.select
!d discord.ui.select
discord.ui.select(*, placeholder=None, custom_id=..., min_values=1, max_values=1, options=..., disabled=False, row=None)```
A decorator that attaches a select menu to a component.
The function being decorated should have three parameters, `self` representing the [`discord.ui.View`](https://discordpy.readthedocs.io/en/master/api.html#discord.ui.View "discord.ui.View"), the [`discord.ui.Select`](https://discordpy.readthedocs.io/en/master/api.html#discord.ui.Select "discord.ui.Select") being pressed and the [`discord.Interaction`](https://discordpy.readthedocs.io/en/master/api.html#discord.Interaction "discord.Interaction") you receive.
In order to get the selected items that the user has chosen within the callback use [`Select.values`](https://discordpy.readthedocs.io/en/master/api.html#discord.ui.Select.values "discord.ui.Select.values").
shortened:
i am blessed yuh,
u aint blessed yuh, x4
serious-end:
i am blessed yuh,
u ain't blessed bruh
lmao
Alright, that's a bit far for here
can someone show me an example for adding a decorator for discord.ui.select
because examples give me the understanding
class View(discord.ui.View):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
@discord.ui.select(custom_id="Some identifier", placeholder="Placeholder", min_values=1, max_values=1, options=[discord.SelectOption(label="Hello", emoji="😳")])
async def callback(self, select: discord.ui.select, interaction: discord.Interaction):
await interaction.response.send_message('Hello', ephemeral=True)
await ctx.send('Test', view=View())
lmao that emoji
The bot's an introvert
hmmm
I just copy posted the code. I am on mobile so yh
bruh
Ghost Ping
dont ghost ping people @upbeat otter
What did u say tho
mistakes happen
nothing
looked like it waant a mistake
¯_(ツ)_/¯
you pinged him, then deleted the message? that aint a mistake lol
Eh just ignore it ig
smh
What did she even say
Leave it, I don't really care anyways (:
Weird
???
is theres a way to make sticky message?
why is not work? await remove.reaction()
await reaction.remove()*
Thank you❤️
(:
what does discord.ui do
how do you subclass on_messagebut its a listener not event
how can i host my bot for free lol?
not using heroku and i cant use railway bc my github acc is less than 30 days old
use epikhost
its free
but you can only host 1 bot
is it 24/7?
mhm
thx
@pliant gulch
@client.command()
async def checkpubmp(ctx):
server = ctx.guild
liste_id_dans_serveur = []
for membre in server.members:
if membre.id in ids:
print(server.members)
print("coucou2")
liste_id_dans_serveur.append(membre.id)
if len(liste_id_dans_serveur) > 0:
print("coucou")
embed = discord.Embed(title="Pour vérifier les preuves", url="")
embed.colour = discord.Colour.red()
embed.description = "> :no_entry: Les ID suivantes **d'utilisateurs qui Pubent MP** ont été détectées :"
await ctx.send(embed=embed)
text = ""
for i in liste_id_dans_serveur:
text = text + str(i) + "\n"
embed = discord.Embed()
embed.colour = discord.Colour.red()
embed.description = text
await ctx.send(embed=embed)
else:
embed = discord.Embed()
embed.colour = discord.Color.green()
embed.description = "> :white_check_mark: Votre serveur ne possède **aucun pubeur MP** de notre base de donnée."
await ctx.send(embed=embed)
Hi excuse me, but my code does not work. There are nothing in the terminal and nothing is send in discord. I dont know why it's broke. Please ping me
ids should be undefined
but I don't think you want this code to work like how you wrote it
this would send a damn lot of messages
await ctx.send(embed=embed)```
would already send as many messages as how many elements there are in that list
this.... is a different command?
oh bruh if you use if message.content.startswith in on_message it works
you have to replace @bot.event with @bot.listen()
in on_message's decorators
how do I create a custom event
a custom one
okay but when does it react
So i want to make a command to bind a channel to an id of an external service(i wont go into detail i just want to store an id for a channel id) how do i do that?
uh not sure just wanted to know the basics of how to create it
well you don't
I think almost every action that you're able to do in discord already triggers an event
Database
i want a custom one
but for what
you won't ever have to do that
I don't think so
but you can look in dpy's source code to see how they do it
hm
so i want to store id's for a channel how do i write that in a variable?
Dont do that because every time you rerun the code, everything will be wiped off
ok but i want to assign id's to channels that's my problem

is it possible to add buttons with python
Thats possible
Which version for dpy?
we're suggesting databases and you're wondering if you should use a dict/json 😢
whichever one is the latest
idk how to use this with database
well you should learn to
!d discord.ui.button
discord.ui.button(*, label=None, custom_id=None, disabled=False, style=<ButtonStyle.secondary: 2>, emoji=None, row=None)```
A decorator that attaches a button to a component.
The function being decorated should have three parameters, `self` representing the [`discord.ui.View`](https://discordpy.readthedocs.io/en/master/api.html#discord.ui.View "discord.ui.View"), the [`discord.ui.Button`](https://discordpy.readthedocs.io/en/master/api.html#discord.ui.Button "discord.ui.Button") being pressed and the [`discord.Interaction`](https://discordpy.readthedocs.io/en/master/api.html#discord.Interaction "discord.Interaction") you receive.
Note
Buttons with a URL cannot be created with this function. Consider creating a [`Button`](https://discordpy.readthedocs.io/en/master/api.html#discord.ui.Button "discord.ui.Button") manually instead. This is because buttons with a URL do not have a callback associated with them since Discord does not do any processing with it.
alright thanks
MongoDB will an easy option, w3school's docs are simplified
How do I get my bot to send a random string of text from an API
ok
Fetch the string from the api then
.send
,-,
no i need it to have the api generate a random string and then send that
specifically:
I need my bot to get a dad joke from dadjokes.io and send it
............you need to scrape the info
!pypi aiohttp
ok
Theres a dadjoke library too, if you wanna simplify your work
wait what
!pypi dadjokes
^
My pleasure
please help with the code for the discord bot. How to make a bot write a text in a chat?
thank you
await ctx.send("msg here")
and how to make sure that when he joins the server, he writes a message to the chat?
consider the on_guild_join event
async def on_message(message):
if message.content.startswith('infinite_dadjokes'):
await message.channel.send(dadjoke)
time.sleep(10)```
so because I changed the source of my dadjokes, my previosu concept doesn't work, how can I make this an infinite loop
time.sleep() 
the bot would get punished
definitely not
ye i tried that but smol brain, idk where to put it
why not
its basic python
So use asyncio.sleep() then ??
while True:
# do things```
Which Discord API is the best one for python out there right now?
!e
def b():
while True:
print(1)
b()
how do i store discord servers, in a database on discord.py?
@boreal ravine :x: Your eval job timed out or ran out of memory.
001 | 1
002 | 1
003 | 1
004 | 1
005 | 1
006 | 1
007 | 1
008 | 1
009 | 1
010 | 1
011 | 1
... (truncated - too many lines)
Full output: too long to upload
disnake
Are you sure? I hear Pycord a lot too
what db u uae
disnake more stable
how to make discord automatically disable all the buttons for me? like a timeout thing on a view?
(uisng discord.py)
loops dont have an async version though
they are called tasks
async for ... in ...:
...
call the timeout kwarg where you call super
use commands
while using while true, your bot won't be able to do anything else
nvm just noticed you're talking about a while loop, there's tasks tho which aren't blocking
So? Whats the point of wanting an infinite loop if it isn't infinite
ive been trying to use discord ipc, i know its archived, and i couldnt get it to work, are there any alternatives/better ways to do it?
TASKS
tasks
!d discord.ext.tasks.loop
discord.ext.tasks.loop(*, seconds=..., minutes=..., hours=..., time=..., count=None, reconnect=True, loop=...)```
A decorator that schedules a task in the background for you with optional reconnect logic. The decorator returns a [`Loop`](https://discordpy.readthedocs.io/en/master/ext/tasks/index.html#discord.ext.tasks.Loop "discord.ext.tasks.Loop").
super().__init__(timeout=60) this will disable all in a min?
why use tasks if the task is gonna loop every second
i suppose, never used timeouts before
set the loop time
ok thx :)
dude
,-,
he wants an infinite loop
smh
i love how my simple request started a controversy
broston
what?
I'm starting to get tired of these
of these?
a task is infinite
thats not what I meant
^
you can set the time, that they will wait before triggering twice
a task is the async version of a while true statement
it isn't blocking
so it's the complete same thing
json file. But id like to save servers in a db, like xenon.
just less code and your bot will be able to do other stuff
then use a db ,-,
how?
learn how to use lol
you dont ask how to use a db
well my bad then
That’s not completely true. It’s entirely dependent on what’s inside the while loop.
im not asking how to use a db. im asking how to link it to my code
just save it using the normal methods
use the native libraries
for json, mongo will server you better
mmhmm
im new to mongo, but i l will learn. 🙂
everyone is new when they start learning
Facts
i once again require assistance
Ignoring exception in command __leaderboard:
Traceback (most recent call last):
File "C:\Users\lqwxx\AppData\Local\Programs\Python\Python38\lib\site-packages\discord\ext\commands\core.py", line 85, in wrapped
ret = await coro(*args, **kwargs)
File "bot1.py", line 285, in __leaderboard
embed.add_field(
TypeError: add_field() got an unexpected keyword argument 'rep'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "C:\Users\lqwxx\AppData\Local\Programs\Python\Python38\lib\site-packages\discord\ext\commands\bot.py", line 939, in invoke
await ctx.command.invoke(ctx)
File "C:\Users\lqwxx\AppData\Local\Programs\Python\Python38\lib\site-packages\discord\ext\commands\core.py", line 863, in invoke
await injected(*ctx.args, **ctx.kwargs)
File "C:\Users\lqwxx\AppData\Local\Programs\Python\Python38\lib\site-packages\discord\ext\commands\core.py", line 94, in wrapped
raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: TypeError: add_field() got an unexpected keyword argument 'rep'
*Infinite Dad Jokes, ACTIVATE
BOT
Yessiree
I fear for the calendar, its days are numbered.
I fear for the calendar, its days are numbered.
I fear for the calendar, its days are numbered.
I fear for the calendar, its days are numbered.*
async def on_message(message):
if message.content.startswith('Infinite Dad Jokes, ACTIVATE'):
await message.channel.send('Yessiree')
if message.author ==client.user:
await message.channel.send(dadjoke.joke)
time.sleep(10)```
I know it's a gimmicky concept but either way, it still spams the same joke
@bot.command(aliases = ['leaderboard', 'lb'])
async def __leaderboard(ctx):
await ctx.channel.purge(limit=1)
embed = discord.Embed(title = 'Топ 10 сервера')
counter = 0
#SELECT name, cash FROM users WHERE server_id
#cursor.execute("SELECT cash FROM users WHERE id = {}".format(member.id)).fetchone()[0]
for row in cursor.execute("SELECT name, cash, rep FROM users WHERE server_id = {} ORDER BY cash DESC LIMIT 10".format(ctx.guild.id)):
counter += 2
embed.add_field(
name = f'# {counter} | `{row[0]}`',
value = f'Баланс: {row[1]}',
rep = f"Репутация: {row[2]}",
inline = True
@bot.event
async def on_ready():
cursor.execute("""CREATE TABLE IF NOT EXISTS users (
name TEXT,
id INT,
cash BIGINT,
rep BIGINT,
lvl BIGINT,
server_id INT
)""")
cursor.execute("""CREATE TABLE IF NOT EXISTS shop (
role_id INT,
id INT,
cost BIGINT
)""")
for guild in bot.guilds:
for member in guild.members:
if cursor.execute(f"SELECT id FROM users WHERE id = {member.id}").fetchone() is None:
cursor.execute(f"INSERT INTO users VALUES ('{member}', {member.id}, 0, 0, 1, {guild.id})")
else:
pass
why?
Swap the joke every new iteration.
i did it with dadjokes library :/

Remove whatever rep is.
That’s not a thing
ok i cant add to to rep
…
@bot.command(aliases = ['rep', '+rep'])
async def __rep(ctx, member: discord.Member = None):
await ctx.channel.purge(limit=1)
if member is None:
await ctx.send(f"**{ctx.author}**, укажите участника сервера")
else:
if member.id == ctx.author.id:
await ctx.send(f"**{ctx.author}**, вы не можете указать смого себя")
else:
cursor.execute("UPDATE users SET rep = rep + {} WHERE id = {}".format(1, member.id))
connection.commit()
await ctx.message.add_reaction('✅')
I don’t know what to tell you then man. If you don’t want to remove it, then enjoy your error. 
i need reputation on lb
Then put it in a new field or something.
dont use ctx.channel.purge
hello fellow russian speaker
how to fix ImportError: DLL load failed while importing _brotli: specified module not found.
english please....
did u install it in terminal
as you say, but I will
you want to delete the command used, right
C:\Users\Laxuzer\Desktop\Yeni klasör>pip install _brotli
ERROR: Invalid requirement: '_brotli'
It's english only tho
:D
im ded ig
!pypi brotli
i text ;lb and await ctx.channel.purge(limit=1) this delete my message
pip install brotli is the package
what if someone else messages at the exact same time
their message gets deleted
Requirement already satisfied: brotli in c:\users\laxuzer\appdata\local\programs\python\python310\lib\site-packages (1.0.9)
Hmmmmmm
use, ctx.message.channel.delete() instead of purging a single message @plucky badger
well, let's say, but I have never had such a thing
Umm....okay if you think you are the smartest and we're dumb
Idk about u but I surely am dumb ngl
same, but not too dumb
It’s still a possibility. Good developers m remove any possible flaws in their code.
how to make it so that the message is deleted after a while
send(delete_after=3)
Seconds? Minutes? Hours? Milliseconds? Nanoseconds?
Seconds
^^^
Seems like it
\🗑️
(:
or maybe everyone has common sense
,-,
Yes
cool , i'll use that for deleting messages
i cant seem to get the message with the view in discord.ui.View, how do i take the message from discord.ui.View object?
oh maybe not Eevee
I just made fun of myself ,-,
I have to choose between KVM VPS and and OpenVZ, what would you choose for a Discord bot host? 😄
Yeah I’ve literally never heard of that before.
Greetings all
I only know linode
Aw
And some others
Sad 😞
Hai Myxi, grinch Hunter, tylerr and Eevee
And Euclid
!ot
Quality over quantity ofc. Don’t pick a vps with many cores but they slow as shit. Same goes with ram and storage.
cogs/imagesearch/_cog.py lines 20 to 23
paginator = Paginator(ctx, embeds=embeds)
paginator.message = await ctx.send(
embed=paginator.current_embed, view=paginator
)```
But I thought storage was important
i mean you don’t need a lot for a discord bot
Wow nice code there myxi
thanks
Unless it’s an economy bot
Unless it gets big ofc
Also keep in mind that as long as u ain't using something like PIL or Tensorflow (highly unlikely), u need more RAM since discord.py takes more RAM than CPU. My bot's ram usage is at 150 MB whereas CPU is hardly at 0.16% even when it's in 86 servers @raw latch
Because it had too many errors and the code was messy af
sorry but i use discord.py
Dont hi me, i'm a bad omen
same thing
It’s literally the same thing lmao
Disnake is basically discord py
I'm looking to host a small bot for a moment, and if it will get popular for sure i will upgrade to a dedicated server. And as the provider says the vps i'm looking to buy its quite decent
Hi
There are times when autocorrect is good and terrible
💀
Lmaoo
That’s fine.
I needed autocorrect because I wrote siscord
The vps i'm talking about has 1GB ram, so i don't think it will have any problem
And that sounded weird
Congrats!
More than enough.
Hello
Damn that's more than enough. My package contains only 500 MB RAM
Hunter is broke. He can’t afford 1 gig.
Ik
the chat has become everything except discussion about discord bots
Off-topic channels
There are three off-topic channels:
• #ot2-never-nester’s-nightmare
• #ot1-perplexing-regexing
• #ot0-psvm’s-eternal-disapproval
Their names change randomly every 24 hours, but you can always find them under the OFF-TOPIC/GENERAL category in the channel list.
Please read our off-topic etiquette before participating in conversations.
U host a discord bot on a VPS
yea
Myxi wanted to say ot so badly
And the chat is regarding VPS
But he left it to Hunter
Sooooo, uhhh
That is true tho 
not !ot
now the chat becomes ded
Thanks for your answers guys
@maiden fable @sage otter
And you retire to python general and be stupid af
It's fine
Cz I am stupid
one little mini tiny question: what does ctx.send return? is it discord.Message?
It sends a message
yes
It returns the sent message
ok thx
Stop typing according to the laws of this chat you stop talking after a while so let’s all be silent for now
I have a question
😐
Go on
how to make a discord bot
I WAS GONNA SAY THAT
embed = discord.Embed(title = 'Репутация')
^
IndentationError: expected an indented block
you indented it wrong
!indent
Indentation
Indentation is leading whitespace (spaces and tabs) at the beginning of a line of code. In the case of Python, they are used to determine the grouping of statements.
Spaces should be preferred over tabs. To be clear, this is in reference to the character itself, not the keys on a keyboard. Your editor/IDE should be configured to insert spaces when the TAB key is pressed. The amount of spaces should be a multiple of 4, except optionally in the case of continuation lines.
Example
def foo():
bar = 'baz' # indented one level
if bar == 'baz':
print('ham') # indented two levels
return bar # indented one level
The first line is not indented. The next two lines are indented to be inside of the function definition. They will only run when the function is called. The fourth line is indented to be inside the if statement, and will only run if the if statement evaluates to True. The fifth and last line is like the 2nd and 3rd and will always run when the function is called. It effectively closes the if statement above as no more lines can be inside the if statement below that line.
Indentation is used after:
1. Compound statements (eg. if, while, for, try, with, def, class, and their counterparts)
2. Continuation lines
More Info
1. Indentation style guide
2. Tabs or Spaces?
3. Official docs on indentation
You make one
i see
Indentation errors 🚶
thanks for the helpful message, it changed my entire life
Oh god I hate it when people say WHY TF IS THERE A FUCKING INDENT ERROR
Indent errors are a nightmare on mobile
You’re welcome
I don’t even have tabs on my phone
I do
Lucky 😕
Modded my keyboard to add a Tab key
how do you do that
embed = discord.Embed(title = 'Репутация')
embed.add_field(
name=f"Выдача репутация",
value=f"**{ctx.author.mention}**, вы не можете указать смого себя"
)
await ctx.send(embed = embed)
By modding
Teach me the way
No
!e
def mobile_developers_be_like():
print("hello")
mobile_developers_be_like()
print("world")
Fuck
Just stick to the four spaces rule and your set. Just go up four everytime you need to indent.
Yea
@sullen shoal :white_check_mark: Your eval job has completed with return code 0.
001 | hello
002 | world
Four Spaces
elsewhere works
not here
why is it not working?
def client_event():
return client.event
client_event()
function async ping[ctx];
ping = client.ping
ctx.await(f"My ping is {ping}")
!e import hello
@velvet tinsel :white_check_mark: Your eval job has completed with return code 0.
Hello world!
Eevee typing a BIIIIIIIG message
This is too powerful
lol
@bot.command()
async def ping(ctx):
await ctx.channel.purge(limit=1)
ping = client.ws.latency
ping_emoji = "🟩🔳🔳🔳🔳"
if ping > 0.10000000000000000:
ping_emoji = "🟧🟩🔳🔳🔳"
if ping > 0.15000000000000000:
ping_emoji = "🟥🟧🟩🔳🔳"
if ping > 0.20000000000000000:
ping_emoji = "🟥🟥🟧🟩🔳"
if ping > 0.25000000000000000:
ping_emoji = "🟥🟥🟥🟧🟩"
if ping > 0.30000000000000000:
ping_emoji = "🟥🟥🟥🟥🟧"
if ping > 0.35000000000000000:
ping_emoji = "🟥🟥🟥🟥🟥"
message = await ctx.send('Пожалуйста подождите. . .')
await message.edit(content = f"Мой пинг `{ping * 100:.0f}мс` {ping_emoji} ")
You indented it wrong ig
Because u just mixed Python, JS, and hunga-banga
Wtf
That’s not correct
You got it wrong
ping in command
,-,
@bot.command(aliases = ['rep', '+rep'])
async def __rep(ctx, member: discord.Member = None):
await ctx.channel.purge(limit=1)
if member is None:
embed = discord.Embed(title = 'Репутация')
embed.add_field(
name=f"Выдача репутация",
value=f"**{ctx.author.mention}**, укажите участника сервера"
)
await ctx.send(embed = embed)
else:
if member.id == ctx.author.id:
embed = discord.Embed(title = 'Репутация')
embed.add_field(
name=f"Выдача репутация",
value=f"**{ctx.author.mention}**, вы не можете указать смого себя"
)
await ctx.send(embed = embed)
else:
cursor.execute("UPDATE users SET rep = rep + {} WHERE id = {}".format(1, member.id))
connection.commit()
embed = discord.Embed(title = 'Репутация')
embed.add_field(
name=f"Выдача репутация",
value=f"**{ctx.author.mention}**, вы не можете указать смого себя"
)
await ctx.send(embed = embed)
Okay Eevee gonna help y'all, I am out, gotta do some things
TypeError: 'send_messages_in_threads' is not a valid permission name.
Basically, according to the laws of getrobidalisnestrgo you have to carry x so that y becomes the tangent of z so you can use the quadratic formulae to find the value of x, y and z
💀
Yeah ok I’m gonna leave now
Bye Eevee have a nice day
I die inside everytime someone uses interpolation in sql strings instead of the builtin placeholders
baii baii, take care
ofc others gonna help u too
Facts
anybody?
That's why... use discdb 😄
Fuck I’m back
where wrong indented
hunter gonna hunt for the missing } in his bio now
@upbeat otter
yeahh
I said that she’s ago
this in console?
Nah imma pass and hunt someone else
Hunter got mad at me
I lost 6 braincells trying to understand
Like really mad
huh?
And yea that too
It’s a joke don’t take it seriously
You didn’t chill
I know
Anyways you also have to initialise quantum formulae as well
eevee this command ping
....
ping = client.latency
my ping 11
~d discord.ext.commands.Bot.latency
Round it first
bot ping 91
oof
😳
!d discord.Client.latency
property latency: float```
Measures latency between a HEARTBEAT and a HEARTBEAT\_ACK in seconds.
This could be referred to as the Discord WebSocket protocol latency.
It's already the websocket latency
What fork is the best rn?
idk maybe disnake
use hata
name = "│⏳ {}".format(member.name)
output = await after.channel.clone(name=name, reason="Joined in Temp-Channel")
if output:
channel_id = output.id
print(channel_id)
id = tchannel.append(channel_id)
print(id)
Hey, could someone tell me why None is output when I want to store the channel_id of a channel in a list?
latter
It’s a library Danny shit on a long time ago
oh
Hata
does it still work
Danny's boot licker?
Said the code was complete and utter garbage
Danny’s toilet
oh
you are just too dumb to understand it lmao.
We have some OG using format
it gud man, let's not fight over it 100th time
it's not even a bloat now, the asyncio stuff is a completely different repo
Wasn’t disnake one of those libraries that removed views? And implemented the "on_button_click" things.
Or is that nextcord 🤔
me who doesnt even know what views are like
Use Andy's lefi ofc.
how to make the message disappear after a while
An example how they look?
it's not complete yet so didn't recommend that
idk about the past but now its good
.....
and disnake has views
how to make the message disappear after a while
send() has a delete_after kwarg
Ohh dropdowns
Wtf was it
ble
Messageable
just do TextChannel.send
hello i have a problem with my bot Alexa 121 i'm trying to get her online please help me
discord.abc.Messageable
await ctx.send(embed = embed)
@novel apex
!d discord.abc.Messageable.send
await send(content=None, *, tts=None, embed=None, embeds=None, file=None, files=None, stickers=None, delete_after=None, nonce=None, allowed_mentions=None, reference=None, mention_author=None, view=None)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).
Sends a message to the destination with the content given.
The content must be a type that can convert to a string through `str(content)`. If the content is set to `None` (the default), then the `embed` parameter must be provided.
To upload a single file, the `file` parameter should be used with a single [`File`](https://discordpy.readthedocs.io/en/master/api.html#discord.File "discord.File") object. To upload multiple files, the `files` parameter should be used with a [`list`](https://docs.python.org/3/library/stdtypes.html#list "(in Python v3.9)") of [`File`](https://discordpy.readthedocs.io/en/master/api.html#discord.File "discord.File") objects. **Specifying both parameters will lead to an exception**.
To upload a single embed, the `embed` parameter should be used with a single [`Embed`](https://discordpy.readthedocs.io/en/master/api.html#discord.Embed "discord.Embed") object. To upload multiple embeds, the `embeds` parameter should be used with a [`list`](https://docs.python.org/3/library/stdtypes.html#list "(in Python v3.9)") of [`Embed`](https://discordpy.readthedocs.io/en/master/api.html#discord.Embed "discord.Embed") objects. **Specifying both parameters will lead to an exception**.
umm
delete_after=?
@broken plinth whats the issue?
umm my bot
hi
She wont get online
pass in the seconds to make it go invisible
Code?
🧠
else:
cursor.execute("UPDATE users SET rep = rep + {} WHERE id = {}".format(1, member.id))
connection.commit()
embed = discord.Embed(title = 'Репутация')
embed.add_field(
name=f"Выдача репутация",
value=f"**{ctx.author.mention}**, кинул репуцацию **{member.mention}**"
)
await ctx.send(embed = embed, delete_after=5)
You what
it's still onlie
Scratch?
That shud work
Scratch for discord
like this Novia>
Like the learning language Scratch?
Yes
By screenshotting your code
Actually I’m not sure if that’s even appropriate here
hmm ook
Scratch isn’t python
umm
TIS IS WY IM HERE ACTUALLY
I KNEED TO KNOW HOW TO CODE ON PYTHON SO I CAN PUT THE SCRIPT RUNNING
O_O
... but its so complicated looking
I wanted to learn how to code for my bot
😦
...
nobody here?
sigh nvm
!resources
The Resources page on our website contains a list of hand-selected learning resources that we regularly recommend to both beginners and experts.
???
Start there.
Hey, i got a question for anyone willing to answer...
...
how do i assign a task to do after 30 seconds using discord.ext.tasks just once?
return await interaction.original_message().delete()
AttributeError: 'coroutine' object has no attribute 'delete'``` 
you wouldnt use a task for just one use
just call the other method
I'm trying to make an embed command for my discord bot, and I want it to mention like @.everyone or something, but when it actually runs, it looks like this...
you can
!d asyncio.create_task || you can use this + await asyncio.sleep(30)
how do I make it look more like dyno's announcements
asyncio.create_task(coro, *, name=None)```
Wrap the *coro* [coroutine](https://docs.python.org/3/library/asyncio-task.html#coroutine) into a [`Task`](https://docs.python.org/3/library/asyncio-task.html#asyncio.Task "asyncio.Task") and schedule its execution. Return the Task object.
If *name* is not `None`, it is set as the name of the task using [`Task.set_name()`](https://docs.python.org/3/library/asyncio-task.html#asyncio.Task.set_name "asyncio.Task.set_name").
The task is executed in the loop returned by [`get_running_loop()`](https://docs.python.org/3/library/asyncio-eventloop.html#asyncio.get_running_loop "asyncio.get_running_loop"), [`RuntimeError`](https://docs.python.org/3/library/exceptions.html#RuntimeError "RuntimeError") is raised if there is no running loop in current thread.
This function has been **added in Python 3.7**. Prior to Python 3.7, the low-level [`asyncio.ensure_future()`](https://docs.python.org/3/library/asyncio-future.html#asyncio.ensure_future "asyncio.ensure_future") function can be used instead...
assign a task normally and stop it after its done
so..?
discord.ext.tasks are simpler tbh
ah ok
oh i need to await delete aswell
not in the slightest
like this
thanks
how to use the better help thing that changes the default python help command.
set both content and embed kwarg
what do you mean. I am very much a beginner. This will be the first command i make that uses arguments
why does it only delete the ctx author message but not the message which has the interaction
class MyButton(Button):
def __init__(self,ctx):
self.ctx = ctx
super().__init__(style=discord.ButtonStyle.danger,emoji=f"{random.choice(Emojis.trash_emojis)}")
async def callback(self, interaction):
if interaction.user.id == self.ctx.author.id:
await self.ctx.message.delete()
return await interaction.delete_original_message()
return await interaction.send_message(f"{random.choice(Replies.error_replies)} {random.choice(Emojis.pepe_sad_emojis)}",ephemeral=True)
bot = commands.Bot(command_prefix=…, help_command=BetterHelp)
something like that - idk what betterhelp is tho lol
!pypi discord-pretty-help
And nicer looking interactive help menu for discord.py
hm
use this
how do i do this?
Wrap it.
For example,
(await Guild.get_channel(id)).delete()
ctx.send(content=ctx.author.mention, embed=embed)
pls no
oh, let me go try that, thank you!!!
await ctx.send(ctx.author.mention, embed=embed)
I FROGOR await 💀
lmao
wdym in reply?
uhm...
yeah it could be specified as positional
that editor is grim
why is the ")" under red?
no its reolit
check indentations
whats that
the spaces / tabs
Dude that indention has to be the most cursed thing I’ve ever seen
yes, but if i add/remove them there will be other errors
You have extra spaces, you got 4 spaced and 2 spaced intentions.
that means?
fix, not add/remove
why the fuck is it all purple except for the parts that should be purple
how 
also why do you have a print just chilling at the top
Follow pep8s intention guide and use 4 spaces everytime you need to indent.
How are indentations so hard when text editors and ides after you press enter they indent it but you still got it wrong?
omg dude did def init
srry i watch yt
@client.command()
async def Test(ctx: commands.Context):
embed = discord.Embed(title="Hello", description="World!")
embed.add_field(name="test", value="TEst", inline=True)
await ctx.send(embed)
🚶
Your sending a embed object
await ctx.send(embed=embed)
await ctx.send(embed=embed)
🕴️
ow man
thanks
This class is more cursed then geometry 🚶

how would I go about making a command that ran something like this
to make an annoucement with pings and mentions
embeds
i know that, but for the async def announce(<what would i put in here>)
of course
Their isnt mentions
🕴️
ctx, *, content
what does the * do (sorry again, im learning)
No need to make it a kwarg
A positional arg would be fine
ask @slate swan
how to make a command pay?
pay?
pay?
Makes all arguments after that a kwarg
transfer money
huh...
and whats a kwarg
not possible 😂
pay user {amount}
economy bot right?
oh you mean in-bot monie
yes
whats that
lol, just minus plus the amount from the required accounts @plucky badger
bruh
lol
idk how
your database is?
Whats what
sql3
the kwarg
oops
what does it mean to make something a kwarg
a kwarg is arguments that are not positional function(kwarg=kwarg)
a positional argument doesnt need to be specified function(arg)
@upbeat otter your checking docs for a kwarg?
Converting to "int" failed for parameter "pep_number".
oh?
lmao ofc no
I mean yes
so...what that mean 🤣
bye
@stark lintel A kwarg is a keyword argument that gets called by its name and doesnt need to be in a certain position as a positional argument
ohhh
explain in english
i don't think he would understand that... 🤔
and how ?
lmao no
🚶
these words are too big
wait til you see misunderstatements
🕴️
How do I make unban command?
Need a db
wtf no
function(variable1, kwarg=variable2)
# ^ ^ Kwarg argument
# positional```
are you crazy
no 😂
Yeah just store the id in a text channel🚶 😭
wtf ...
😭
that is not required
!d discord.Guild.bans
bro just unban the id.,,
await bans()```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).
Retrieves all the users that are banned from the guild as a [`list`](https://docs.python.org/3/library/stdtypes.html#list "(in Python v3.9)") of [`BanEntry`](https://discordpy.readthedocs.io/en/master/api.html#discord.BanEntry "discord.BanEntry").
You must have the [`ban_members`](https://discordpy.readthedocs.io/en/master/api.html#discord.Permissions.ban_members "discord.Permissions.ban_members") permission to get this information.
Ik i was joking🕴️
is this an excuse 🤨
nah you werent mate
No🕴️
Yes🕴️
Was supposed to be a joke but you guys cant take one🚶
i am out
Lol
how to create a command to transfer money in a discord bot?
ever attempted it?
😭
actual money?
no idk how
if not we just don't make spoonfeedable code for you lmao
no
Isnt the coro to unban like await unban(**kwargs)
virtual money for discord server
try brainstorming and making one
then show it to us, we don't know much about your bot and code
!d discord.Guild.unban
await unban(user, *, reason=None)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).
Unbans a user from the guild.
The user must meet the [`abc.Snowflake`](https://discordpy.readthedocs.io/en/master/api.html#discord.abc.Snowflake "discord.abc.Snowflake") abc.
You must have the [`ban_members`](https://discordpy.readthedocs.io/en/master/api.html#discord.Permissions.ban_members "discord.Permissions.ban_members") permission to do this.
because we don't know the money variable, we don't know if you indexed a tuple (🕴️)
Hey @plucky badger!
It looks like you tried to attach a Python file - please use a code-pasting service such as https://paste.pythondiscord.com
🕴️
🕴️
🕴️
you didn't see that
crap you actually use dbs
😭 🚶
and its sql so idk how to help
😦
imagine using discord components
pfff, real chads use discord.py 2.0
^^
Let me use my text channel as a db🕴️
no u
🕴️ sure
Text channel > any db🕴️

!e
mytextchannel = bot.get_channel(483958405854385093)
await self.mytextchannel.excute('bruh')
@shadow wraith :x: Your eval job has completed with return code 1.
001 | File "<string>", line 2
002 | SyntaxError: 'await' outside function
🚶
#databases if its database related
signs that you are a chad ✨
you use discord.py 2.0
"hey man what discord.py ver u use?"
"2.0"
"wow ur a chad how"
"i follow josh otusanya 😎 mwahah"
You forgot josh laughing
The finale best part
i am indeed a chad
i'm a somewhat chad because real chads only find defining the args in @discord.ui.select easy
You follow? josh otusanya
i did, i put "mwahah"
You aint a chad
More*
but i live in chad
Not anymore🕴️
i have proof:
< insert proof >
!ot
Off-topic channels
There are three off-topic channels:
• #ot2-never-nester’s-nightmare
• #ot1-perplexing-regexing
• #ot0-psvm’s-eternal-disapproval
Their names change randomly every 24 hours, but you can always find them under the OFF-TOPIC/GENERAL category in the channel list.
Please read our off-topic etiquette before participating in conversations.
🕴️
🕴️ your as specific as the decorator for selects in dpy 2.0
Welp im going to use a db to store a db so the dbs store more dbs🕴️
what db, mongo? 🕴️
No json🕴️
🕴️ and how are you planning to use that in your discord bot
bro u still use SQL or its freins?
<discord.py talk here>
No i use json ofc🕴️
bro u said no json 🔫
Yes json🕴️
Maybe json 🕴️
Am i json🕴️
the trilogy of jsons are complete.
ok
Yes
now we have to figure out how many kwargs can you specify in a @discord.ui.select
Imagine if someone used a db to send a msg:sob:
🙂
Json is the best db
yeaaaahh
fr this is not #databases
!ot
Off-topic channels
There are three off-topic channels:
• #ot2-never-nester’s-nightmare
• #ot1-perplexing-regexing
• #ot0-psvm’s-eternal-disapproval
Their names change randomly every 24 hours, but you can always find them under the OFF-TOPIC/GENERAL category in the channel list.
Please read our off-topic etiquette before participating in conversations.
anyways
😌
who even likes it 😂
anyways
did anyone use instaloader for discord bot?
Tf is that.
For what and what is that
for instagram scrapping, instagram scrapping api
he knew how to make a help command the correct way
Idk never used it
Still outdated
they're like yeahhhhhhhh discord.py dead af let's import some shitty unknown module made by not_hacker_69_420 and then we do stuff like bot = commands.Bot() and yeah @bot.event you know all these stuff and then paste some fucking piece of code and boom you made dank fucking memer be sure to like and subscribe
yeah ikr i think no one used it tho for bot
idk lel
Idrk
I like scraping
How do I make a command work only for certain roles?
And what are you gonna scrape 😳
No
in #databases nobody is answering
reels
commands.has_role() I think
Alr🕴️
hehe
scrape the ice off the roof
Is that even a thing🕴️
We prohibit crawling, scraping, caching or otherwise accessing any content on the Service via automated means, including but not limited to, user profiles and photos (except as may be the result of standard search engine protocols or technologies used by a search engine with Instagram's express consent).
Instagram ToS
!d discord.ext.commands.has_role
@discord.ext.commands.has_role(item)```
A [`check()`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.check "discord.ext.commands.check") that is added that checks if the member invoking the command has the role specified via the name or ID specified.
If a string is specified, you must give the exact name of the role, including caps and spelling.
If an integer is specified, you must give the exact snowflake ID of the role.
If the message is invoked in a private message context then the check will return `False`.
This check raises one of two special exceptions, [`MissingRole`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.MissingRole "discord.ext.commands.MissingRole") if the user is missing a role, or [`NoPrivateMessage`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.NoPrivateMessage "discord.ext.commands.NoPrivateMessage") if it is used in a private message. Both inherit from [`CheckFailure`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.CheckFailure "discord.ext.commands.CheckFailure").
Changed in version 1.1: Raise [`MissingRole`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.MissingRole "discord.ext.commands.MissingRole") or [`NoPrivateMessage`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.NoPrivateMessage "discord.ext.commands.NoPrivateMessage") instead of generic [`CheckFailure`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.CheckFailure "discord.ext.commands.CheckFailure")
🕴️
https://stackoverflow.com/questions/46304407/how-to-make-someone-need-a-role-to-use-a-command it does
Guess it is
:)
https://paste.pythondiscord.com/etoqoxibiv.py
how to create a command to transfer money in a discord bot?
Stop being in stackoverflow
finally I got something right faster than you
Those questions are older than you
Don't ask here and in #databases..
nobody is answering
!rule 5
5. Do not provide or request help on projects that may break laws, breach terms of services, or are malicious or inappropriate.
Im older than you🚶 🕴️
You're using youtube_dl
Which is against YouTube's Terms of Service
no you're not 🚶
And therefore we can't help you
so hes 4 🤨
What ever you say🕴️
us stup>
No hes same age as you🕴️
where play command?
Look your imports :)
mhm... but after restart the bot (for updates) the var is reseted, yeah?
So correct hes 5🕴️
stay on topic please
Yes ofc🕴️
you are a genius import is, but there are no teams
Gotcha
so, a database is btr then it
Yeah 🕴️
ok
[...]
import connect
import voice
import youtube_dl # uh oh what's this O.o
import random
import time
import pyowm
you are a genius import is, but there are no teams
Using youtube_dl therefore your project breaches the terms of service of YouTube
And therefore the #rules 5
If you break tos withing discord i think you break their tos
Is that a thing?
hah
I remember being in tos
What does that have to do with anything lmao.
i dont use youtube_dl
[...]
import connect
import voice
import youtube_dl # uh oh what's this O.o
import random
import time
import pyowm
import is, but there are no teams
Allow me to doubt
import is, but there are no teams
import is, but there are no teams
Spamming won't prove you're not using it
"import is, but there are no teams" what does this mean?
Probably imported but not used
Idk ig imports it but doesnt get used idk what for
Which is really doubtful
I'm too lazy to remove unnecessary imports
Why did you imported it then 
Takes like 4 secs 🕴️
Downloaded an entire bot from GitHub?
this code was written before the update terms
Man that code really is something. Db shit in the on_ready(), interpolation on sql strings
proof>
And now please don't take us for fools
What's the best way to store a token?
;play - воиспроизвести музыку (перед тем как писать зайдите в канал)
;stop - остановить музыку
;join - бот войдет в твой канал
;leave - бот выйдет с твоего канала
;skip - пропустить песню
.env files
what am i doing wrong?
and?
how can I get the token from a env file? whats the module called
Clearly is a music bot
Os?
So stop asking further please, thanks
stupid>
No I'm not unfortunately for you
bruh I mean env
Watch your language
You're taking of for stupid people, so just move on
You use os to get something from a env file
shut up
u sure..?
this is the error i get
you see commands play?
Or are you talking about somehing else
no ?
move you if u stupid
Your project is breaching YouTube's terms of service
@daring olive are you allowed to mute him or something?
proof>
Your code says it
You get a var from a env file with os
where commands play?
!ytdl
Per Python Discord's Rule 5, we are unable to assist with questions related to youtube-dl, pytube, or other YouTube video downloaders, as their usage violates YouTube's Terms of Service.
For reference, this usage is covered by the following clauses in YouTube's TOS, as of 2021-03-17:
The following restrictions apply to your use of the Service. You are not allowed to:
1. access, reproduce, download, distribute, transmit, broadcast, display, sell, license, alter, modify or otherwise use any part of the Service or any Content except: (a) as specifically permitted by the Service; (b) with prior written permission from YouTube and, if applicable, the respective rights holders; or (c) as permitted by applicable law;
3. access the Service using any automated means (such as robots, botnets or scrapers) except: (a) in the case of public search engines, in accordance with YouTube’s robots.txt file; (b) with YouTube’s prior written permission; or (c) as permitted by applicable law;
9. use the Service to view or listen to Content other than for personal, non-commercial use (for example, you may not publicly screen videos or stream music from the Service)
you can prove it with a cmd and not with text
Guys please be respectful 🕴️
okimii i need help again 
<@&831776746206265384> Could someone say to @lqwxx//#2081 that youtube_dl is against YouTube's terms of service and therefore against #rules 5. The code clearly says it has play command (see help command). And is also being rude/toxic for no special reason.
😄
!mute 632869335882399775 6h as others have stated, using ytdl or similar is against our #rules. additionally do not be rude to other users that are explaining this to you
:incoming_envelope: :ok_hand: applied mute to @plucky badger until <t:1639257670:f> (5 hours and 59 minutes).
Thanks 
@slate swan
https://dev.to/jakewitcher/using-env-files-for-environment-variables-in-python-applications-55a1, apparently you need a module called dotenv, which was what i was asking about 🙂 thanks though
What are you trying to do exactly?
Alr
this, its the same announce command i was attempting to work on earlier
Dont know
2 hours ago i was asleep 🕴️
rip same
**message makes it a kwarg
ok, imma go fix that real quick
*args - tuple
**kwargs - dict
Lol
That’s where this error came from
@sage otter like this, or two astericks
How do I add reactions to a message?
so i should remove everything within the client.command parenthesis
?
You can keep the brief
Message.add_reaction()
let me go try that
So like this?
poll = await channel.send(embed=poll_embed)
await poll.add_reaction(":arrow_up_small:")
await poll.add_reaction(":arrow_down_small:")
црут ш кгт ершы
Try it out?
?
Its alr
Command raised an exception: HTTPException: 400 Bad Request (error code: 10014): Unknown Emoji
what i was trying to say...
I keep getting this error everytime !w leaderboard is ran
when i run this, i still get the same error as before
You can’t pass the emojis like that.
oh



