#discord-bots
1 messages · Page 54 of 1
hehe
hi
anyways, if you dont mind, would you once again tell me what to do to fix my issue? 🥺
im first to respong
you are too fast master
Yeah from a quick look at it I prefer aiohttp
seriously tho, pls
define aiohttp session in setup_hook, here's an example: https://gist.github.com/Master326486/6cf48c1ca0509b98e673451e356ba625#setup-hook
ight thx master69, i mean master 32
Master... Master how should I make that it added 5 cookies on every message?
add 5 cookies to user's balance?
yes
that was an answer
lmao
STOP IT OR G-
G-?
iirc syntax is cookies + 1
example: py await cursor.execute("UPDATE your_table SET (cookies) VALUES (cookies + 1)")
no me on your child
WOW
ok
oops that's +1
you mean my sperms? cause i dont have kids yet 💀
you need + 5
weird
what is this
😳
are you sure you're allowed to talk like that?
Wow I just realized how bad I am at sql
UPDATE table
SET cookies = cookies + 1
WHERE user_id = ...
so u are not 40 year old man trying to learn python and get a paying job that u can feed your 9 kids?
no, I realised how bad I am when saw sarth's message
didnt ask for your bio 💀
I would have first got the value and then updated in seperate statements
kids addicted to devices at that age
@mighty basinraters
ok SO you are making it confusing for me
nice
lmao
like seriously tho, ima shut up and go back to work
it is now completely correct and clear
what the heck is confusing
thats the syntax
I did wrong, my apologies
he did right
i am dumb
he is genius
hmm
You dont work all day?

what should be after the user_id
that'd be good if I could so:( I have no chances of finishing rewriting Hokker in this summer
whats your table structure? that was an example
hokker 💀
2 rows?
no, i go to college ;-;
nice name
i love rewriting stuff😳
There was an error in getting webhook
and?
do you mean columns?
guys I got massive error on the bot idk why its not working can anyone please help me to fix the bot?
and-
ye ye i call it rows
i kill people there
yes, double k
I would remove the try except to see what that error is
get better at managing your time
🤦
if anyone can help I would be very happy that the bot will finally be finished
ok sir 😟
how do you manage to have only 80 lines per file on average
so can anyone please help?
error is like html error but I coded the thing on python
can u teach me? I'm so bad at it
Show error
send the error
Replit?
rewrite the file 3 times😎
you are ratelimited sir, are you using replit?
if possible, me too ;-;
You’re probably being ratelimited
im out
Yo exactly what I was thinking
yes
no, im not good at it either, kek
Solution: don’t use replit
replit moments
cuz I'm coding the bot with my friend
change to vsc like me
kill 1 in shell and good to go
😭 😭 😭
these people will help you
Hello! I was trying to make a delete command for my discord. I want the user to type: !delete (amount) but how do i make that?
This is what i tried:
await message.delete()```
Use GitHub?
Hey @slate swan!
You either uploaded a .txt file or entered a message that was too long. Please use our paste bin instead.
Putting a bandaid on a large wound
!paste
Pasting large amounts of code
If your code is too long to fit in a codeblock in Discord, you can paste your code here:
https://paste.pythondiscord.com/
After pasting your code, save it by clicking the floppy disk icon in the top right, or by typing ctrl + S. After doing that, the URL should change. Copy the URL and post it here so others can see it.
it doesnt work in replit 💀
gitlab 😎
https://paste.pythondiscord.com/epoboxuzoq here is the error
@slate swan we know what the error is, you don’t have to send it
??
yeah ofcourse, but in case they are just doing a multiplayer there
a paper cut is good enough to make someone cry
it does, atleast for the last time i checked
discord.utils.utcnow and discord.utils.format_dt
HTML errors with discordpy can only mean one thing: you’re using replit
what
The solution is to ditch replit because it’s hot garbage
can u help me fix them?
Hello! I was trying to make a delete command for my discord. I want the user to type: !delete (amount) but how do i make that?
This is what i tried:
await message.delete()```
Yes, ditch replit
*you're ratelimited 😔
I'll post the code in vs code
and see if there is any errors
Those two are often synonymous
ayo as an ex replit user, i can 100% tell you, its just how replit it, it aint good anymore try to shift over to vsc, and that error is annoying af thats why i have shifted
because an endpoint returns a body of HTML doesnt mean youre using replit, its just cloudfare returns that HTML content💀
Maybe, but they shouldn’t be a ratelimit error
U wanna delete an amount of messages in the channel?
yes
if you wanna code on a browser get github students plan and use github codespaces
alr amma post the code in vs code if any errors can yall help me?
!d discord.TextChannel.purge
await purge(*, limit=100, check=..., before=None, after=None, around=None, oldest_first=None, bulk=True, reason=None)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).
Purges a list of messages that meet the criteria given by the predicate `check`. If a `check` is not provided then all messages are deleted without discrimination.
You must have the [`manage_messages`](https://discordpy.readthedocs.io/en/latest/api.html#discord.Permissions.manage_messages "discord.Permissions.manage_messages") permission to delete messages even if they are your own. The [`read_message_history`](https://discordpy.readthedocs.io/en/latest/api.html#discord.Permissions.read_message_history "discord.Permissions.read_message_history") permission is also needed to retrieve message history.
Changed in version 2.0: The `reason` keyword-only parameter was added.
Examples
Deleting bot’s messages...
I’m guessing they don’t have to because they mentioned trying it in VSC
these people are the best for sure
you need to call utcnow
they will help you as i am still in training
how to make buttons in bot?
!d discord.ui.View
class discord.ui.View(*, timeout=180.0)```
Represents a UI view.
This object must be inherited to create a UI within Discord.
New in version 2.0.
See the GitHub examples under the views folder
discord.ui 🛐
You can get rhe current time with discord.utils.utcnow() then pass it into discord.utils.format_dt then u got the time stamp
ehm I'm new to vscode can yall help me to how to use it?
ayo people help the guy ;-;
What specific questions do you have?
start first
from sqlite3 import Cursor
import discord
from discord.ext import commands
import aiosqlite
import random
bot = commands.Bot(command_prefix='>', intents=discord.Intents.all())
async def open_account(member: discord.Member):
db = await aiosqlite.connect("jar.db")
cursor = db.cursor()
cursor = await db.execute(f'SELECT * FROM jar WHERE member_id = {member.id}')
result = await cursor.fetchone()
if result:
return
if not result:
await cursor.execute(f"INSERT INTO jar(member_id, cookies) VALUES(?, ?)", (member.id, 0))
await db.commit()
await cursor.close()
await db.close()
@bot.event
async def on_message(message):
db = await aiosqlite.connect("jar.db")
cursor = db.cursor()
await cursor.execute(f"""UPDATE table
SET cookies = cookies + 1
WHERE user_id = {message.author.id}""")
bot.run("<token>")
whole thing became this and I want to open a new thing so that I could put the code there
I did this
I did this till now
I think “how to use VSC” might be too broad in scope to be answered in such a way that it’s of any help
and error
lovely 2000's look
install it... install python on your device
go to extensions, install python extension
you can run the code using the "run" option above and clicking on run without debugging or enter python filename.py in the terminal
thats all the basics ig?
2022-08-24 10:03:53 INFO discord.client logging in using static token
2022-08-24 10:03:58 INFO discord.gateway Shard ID None has sent the IDENTIFY payload.
2022-08-24 10:03:58 INFO discord.gateway Shard ID None has connected to Gateway (Session ID: 9efecfbe9d7b3d0af94dfbbbbe6723a6).
2022-08-24 10:04:30 ERROR discord.client Ignoring exception in on_message
Traceback (most recent call last):
File "C:\Users\8ster\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\client.py", line 466, in _run_event
await coro(*args, **kwargs)
File "c:\Users\8ster\OneDrive\Desktop\projects\Discord Bots\Novicookies\main.py", line 31, in on_message
await cursor.execute(f"""UPDATE table
AttributeError: 'Result' object has no attribute 'execute'
C:\Users\8ster\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\client.py:471: RuntimeWarning: coroutine 'Connection.cursor' was
never awaited
await self.on_error(event_name, *args, **kwargs)
RuntimeWarning: Enable tracemalloc to get the object allocation traceback```
how to fix my screen
how to fix this
send() got an unexpected keyword argument 'components'
probably the version ig
don't see an issue there? if you mean the split screen, close one of the tabs
yeah.. I'm downloading pycharm again..
Also this doesn’t look related to #discord-bots
pip uninstall discord.py then pip install discord.py==1.7.3
idk whats wrong in helping a guy trying to make a discord bot tho 🤷♂️
huhhhhh?
why???
WHY?
Why downgrade
im interested how long will it be when i put it on my host
bye master
what host do u use?
glhf bye
who cares
i got the same error
my mom does
He’s just to embarrassed to admit he uses replit
@silk fulcrum showing this
what does she need that for?
me???
to host
NEVER
Yeah tell us the host
heroku is better that replit atleast
Isn’t heroku for websites
can't I use it for my bot?
i dont know myself, it's my dad's host, it gives me smth like a VM with Ubuntu terminal and I can do whatever I want, I can host anything there
Idk it’s also supposed to be bad for bots
Here
my current bot have 24/7 runtime and last time it was offline was 4 days ago for 5-7 hours somthing
Idk
and my never goes offline 😎
unless when I'll run out of memory
heroku is good if its an interaction based bot, which is not possible if you're using discord.py :p
hnhhhhhhhhhhhhhhhhhhheeeeeeeeeeeee
restcord 💀
never dies
Well Idk how discord.py uses interaction but u like use bot.dispatch
Wait no forgot about gateway
Nvm what I said
@slate swan were you part of CJ?
yeah Gateway is the issue, heroku is meant for websites and webservers etc
sadly not, i had my senior secondary school exams going on 😔
Ah alright. Could swear you were 😆 I’m just losing my marbles
besides that theres a library called discord-interactions or something which worked with flask, it was nice too
hikari and some other libs have rest only support as well
i mean i applied and had that green role for a while
ehm guys how to open new tab?
doesn't work
nvm I think I got it
what kinda theme is that ☹️☹️
how to fix this
try alt+enter btw
what will that do?
show quick fixes of that problem
oh I see my problem
appeal- is just laying there
ik I fixed it
but now it shows this
and idk how to fix
whenever I use ban cmd it shows this
and cmd doesn't work
It’s “url” not link
did u try alt + enter again?
wdym
well it probably wouldn't have told you that there is url kwarg
how do I fix the thing
change link to url
how do I fix??
alr
Is this fake pycharm or smth, looks hella weird
It looks so fucking ugly
that's like.. dark-material-darkness-dark-dark-black-theme
ugh now unban error
its theme
Show the full traceback and code
Or we can’t help you
!paste
Pasting large amounts of code
If your code is too long to fit in a codeblock in Discord, you can paste your code here:
https://paste.pythondiscord.com/
After pasting your code, save it by clicking the floppy disk icon in the top right, or by typing ctrl + S. After doing that, the URL should change. Copy the URL and post it here so others can see it.
its a high contrast theme
Oh hell
there I didn't paste the ticket
@slate swan
We didn’t need your full code
I have standard theme with some modified highlight colors
Just full traceback and a little snippet of the code that’s causing the error
anyways that's the full code
how to fix it now?
Give the error???
Traceback (most recent call last):
File "C:\Users\hp\PycharmProjects\Dragon_Bot\venv\lib\site-packages\discord\ext\commands\core.py", line 190, in wrapped
ret = await coro(*args, **kwargs)
File "C:\Users\hp\PycharmProjects\Dragon_Bot\main.py", line 176, in unban
TypeError: object async_generator can't be used in 'await' expression
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "C:\Users\hp\PycharmProjects\Dragon_Bot\venv\lib\site-packages\discord\ext\commands\bot.py", line 1347, in invoke
await ctx.command.invoke(ctx)
File "C:\Users\hp\PycharmProjects\Dragon_Bot\venv\lib\site-packages\discord\ext\commands\core.py", line 986, in invoke
await injected(*ctx.args, **ctx.kwargs) # type: ignore
File "C:\Users\hp\PycharmProjects\Dragon_Bot\venv\lib\site-packages\discord\ext\commands\core.py", line 199, in wrapped
raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: TypeError: object async_generator can't be used in 'await' expression```
@slate swan
async generator can’t be used in await
^
You take it and fix
Don’t await it
delete the await
^^^
async for ... in bans(*, limit=1000, before=..., after=...)```
Retrieves an [asynchronous iterator](https://docs.python.org/3/glossary.html#term-asynchronous-iterator "(in Python v3.10)") of the users that are banned from the guild as a [`BanEntry`](https://discordpy.readthedocs.io/en/latest/api.html#discord.BanEntry "discord.BanEntry").
You must have the [`ban_members`](https://discordpy.readthedocs.io/en/latest/api.html#discord.Permissions.ban_members "discord.Permissions.ban_members") permission to get this information.
Changed in version 2.0: Due to a breaking change in Discord’s API, this now returns a paginated iterator instead of a list.
Examples
Usage...
Now python lost async support since he deleted await 💀
still an error
[2022-08-24 21:51:42] [INFO ] discord.client: logging in using static token
[2022-08-24 21:51:46] [INFO ] discord.gateway: Shard ID None has connected to Gateway (Session ID: 45c9806c50a867f9c09d0cdbcf27ff9b).
Dragon Bot is ready to fly in Discord Life
[2022-08-24 21:51:56] [ERROR ] discord.ext.commands.bot: Ignoring exception in command unban
Traceback (most recent call last):
File "C:\Users\hp\PycharmProjects\Dragon_Bot\venv\lib\site-packages\discord\ext\commands\core.py", line 190, in wrapped
ret = await coro(*args, **kwargs)
File "C:\Users\hp\PycharmProjects\Dragon_Bot\main.py", line 177, in unban
for ban in bannedUsers:
TypeError: 'async_generator' object is not iterable
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "C:\Users\hp\PycharmProjects\Dragon_Bot\venv\lib\site-packages\discord\ext\commands\bot.py", line 1347, in invoke
await ctx.command.invoke(ctx)
File "C:\Users\hp\PycharmProjects\Dragon_Bot\venv\lib\site-packages\discord\ext\commands\core.py", line 986, in invoke
await injected(*ctx.args, **ctx.kwargs) # type: ignore
File "C:\Users\hp\PycharmProjects\Dragon_Bot\venv\lib\site-packages\discord\ext\commands\core.py", line 199, in wrapped
raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: TypeError: 'async_generator' object is not iterable
async for, not for
It needs to be an asynchronous for loop
so how do I fix
...
Omd
async for item in async_iterable
usually I used to write code and my friend fix all the errors but now am kinda alone
Learn python?!?
where
Sir, you are a low functioning human being

so how to fix it which line I change
I'm a little new to discord.py
It needs to be async for not just for
async for ban in bannedUsers
right? @slate swan
You are getting closer
sooo
btw you could just async for bans in ctx.guild.bans():
alr lets test now
but its the same
bannedUsers 💀
Are they okay??
lol
no
Why not
I was going to become a spoonfeeder but you saved me from that terrible fate
It had to be done
your baby's gonna have a good time
Yeah I will
this is the code can yall help me to fix unwarn please?
Unwarn wtf
like 2?warn, 2?warnings and 2?unwarn
Consider learning how to debug code
Learning python is also helpful
Relying on your friend tk fix code isn’t good practice
And this channel is really last resort
@commands.has_role("🍀Helper | Trial Mod")
async def unwarn(ctx, member: discord.Member):
guild_name = await bot.fetch_guild(986712675562188871)
try:
file_name = 'reports.json'
with open(file_name, 'r', encoding='utf-8') as f:
my_list = json.load(f)
print(my_list)
user_short = member.name
for idx, obj in enumerate(my_list):
if obj["name"] == user_short:
my_list.pop(idx)
new_file_name = 'reportdumps.json'
with open(new_file_name, 'w', encoding='utf-8') as f:
f.write(json.dumps(my_list, indent=user_short))
except Exception as e:
print(e)
await ctx.send(f"```There was a problem with resetting {user_short}'s warns in {guild_name}```")
return
try:
unwarnEmbed = discord.Embed(
title=f"⛔ {user_short}'s warns in {guild_name} have been reset",
color=0xf1c40f
)
await ctx.send(embed=unwarnEmbed)
except Exception as e:
print(e)
bruh
how do I fix this..
I feel dumb today amma be honest lmao
get some sleep then
nah
I gotta finish this, tommorow is school
so please guyss
string indices must be integers
{'users': [{'name': 'Pengu', 'reasons': ['a']}]}
string indices must be integers
it only shows this
@slate swan
F to people who have school in summer
hello
my on_message is interfering with my commands
@client.event
async def on_message(message):
if message.author == client.user:
return
if message.content.lower() == "hello":
await message.channel.send("Hello:wave:")
class MyView(discord.ui.View):
@discord.ui.select(
placeholder = "What do you need help with?",
min_values = 1,
max_values = 1,
options = [
discord.SelectOption(
label="Math Command",
description="View math commands",
value="value1"
)
]
)
async def select_callback(self, interaction, select):
if select.values[0] == "value1":
await interaction.response.send_message("Math Commands:\n\n Addition command:\n.add adds two numbers together, eg: .add 2 2 will output 4")
@client.command()
async def helpcommands(ctx):
await ctx.send("Select a help command", view=MyView())```
bro July ended already
ughh I guess I'll fix tommorow
In my country it always starts from September
I think you can use client.listen() instead of client.event
ok
most people start August
*other countries
we start in september in the uk
mo
May
no
Sometimes June
L
july LOL
bro what, what country u in im moving in
we end around 29th july start in september 15th
Russia, you are welcome
nvm
don't move there
LOOOOL
Russia is a good country to live in trust
ye 100%
I live on mars
me too

want to meet?
in
im down where you at?
southeast co ordinates are 234, -324
alright, im coming
What latency is there on mars
The real question is why the hell my ID ends with 666
Nitro sucks
cause im the chosen one, simple😼
mine ends with 111 which is the number of god or something like that
youre my enemy now😳
😈
How could a conversation about discord bots go to the eternal fight with good and evil
lolllllll
when u coming, ur taking too long
im in titan for some reason
bro dont come to me anymore
too long
im going to sleep 😴
😔
Why does my bot, after using slash command, give an error first, and then the result?
What error
"interaction took too long to respond"?
Defer the response
await inter.response.defer()
do that stuff in setup_hook, not on_ready
on_message might get called before on_ready so do as @slate swan said
Ok then override start method
What
@vale wing
@slate swan yes use this
well, make the setup_hook or whatever you want to call it function and call it manually ```py
bot = MyBot()
async def main():
await bot.setup_hook()
await bot.start()
asyncio.run(main())```
anyone know why await channel.send("Hello @sly mirage") doesnt ping the user anymore and just sends "<@id>"?
Traceback (most recent call last):
File "C:\Users\ToxicPenguin\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\commands\core.py", line 113, in wrapped
ret = await coro(arg)
File "C:\Users\ToxicPenguin\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\commands\core.py", line 762, in _invoke
await self.callback(self.cog, ctx, **kwargs)
File "c:\Users\ToxicPenguin\Desktop\проекты на Python\disocrd bot python\cogs\slash.py", line 33, in _ping_
await interaction.response.defer(f'**{interaction.author.mention}** {hug} **{member.mention}**', embed=embed)
TypeError: defer() got an unexpected keyword argument 'embed'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "C:\Users\ToxicPenguin\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\bot.py", line 755, in process_application_commands
await ctx.command.invoke(ctx)
File "C:\Users\ToxicPenguin\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\commands\core.py", line 312, in invoke
await injected(ctx)
File "C:\Users\ToxicPenguin\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\commands\core.py", line 119, in wrapped
raise ApplicationCommandInvokeError(exc) from exc
discord.commands.errors.ApplicationCommandInvokeError: Application Command raised an exception: TypeError: defer() got an unexpected keyword argument 'embed'```
the user is not in the server? user_mentiond is turned off in AllowedMentions?
now just a mistake
you didn't make a setup_hook tho?
create it and move the connection code inside it
@vale wing Probably because I use embed, this one doesn't work
slash commands with embed cannot send messages containing gif ?
they can
@slate swan it just works strangely for me. The way they tell me it doesn't work at all. And the way it's done works for me, but with an error. That is, an error is issued first, and then the result that is needed
defer doesn't take any args
@slate swan I need this line await inter.response.defer() Should I insert after embed or before ?
that shouldn't matter
also, you can just inter.response.create_response
okay weird
@slate swan my code
@commands.slash_command(name = 'ping', description="Обнять участника сервера")
async def _ping_(self, interaction: discord.Interaction, * , member: discord.Member = None):
if member is None:
embed = discord.Embed(description = 'Укажите ID пользователя или его линк через @', colour=0xF1C40F)
await interaction.send(embed=embed)
return
if member.bot == True:
embed = discord.Embed(description = 'Вы не можете обнять бота', colour=0xF1C40F)
await interaction.send(embed=embed)
return
if member == interaction.author:
embed = discord.Embed(description = 'Вы не можете обнять самого себя', colour=0xF1C40F)
await interaction.send(embed=embed)
return
hug = (random.choice(["обнял","крепко обнял","прижал к себе","приобнял"]))
embed = discord.Embed(colour=0xF1C40F)
embed.set_image(url =random.choice(['link']))
await interaction.send(f'**{interaction.author.mention}** {hug} **{member.mention}**', embed=embed)```
is that pycord?
interaction.send isn't really a thing from what i remember
no
@slate swan I know that when using slash, you need to output messages the wrong way. But when I write await interaction.response I just get an error and that's it
how to output ``TypeError: 'Interaction Response' object is not callable" ?
sarth after seeing strange discord bot code
"Must be pycord."
@shrewd apex no. Error Application Command raised an exception: TypeError: 'coroutine' object is not callable
how did u use it show
@commands.slash_command(name = 'ping')
async def _ping_(self, interaction: discord.Interaction, * , member: discord.Member = None):
if member is None:
embed = discord.Embed(description = 'Укажите ID пользователя или его линк через @', colour=0xF1C40F)
await interaction.send(embed=embed)
return
if member.bot == True:
embed = discord.Embed(description = 'Вы не можете обнять бота', colour=0xF1C40F)
await interaction.send(embed=embed)
return
if member == interaction.author:
embed = discord.Embed(description = 'Вы не можете обнять самого себя', colour=0xF1C40F)
await interaction.send(embed=embed)
return
hug = (random.choice(["обнял","крепко обнял","прижал к себе","приобнял"]))
embed = discord.Embed(colour=0xF1C40F)
embed.set_image(url =random.choice(['link']))
await interaction.response.send_message()(f'**{interaction.author.mention}** {hug} **{member.mention}**', embed=embed)```
ow do i make ma bot send a msg to a different cannel, (wit canel id)
...
@shrewd apex sp
bruh add ur stuff in the bracket
hello there
nah actually pycord had a .send method for interaction contexts lol
@shrewd apex...
fetch the channel first
!d discord.TextChannel.send
erm
await send(content=None, *, tts=False, embed=None, embeds=None, file=None, files=None, stickers=None, delete_after=None, nonce=None, allowed_mentions=None, reference=None, ...)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).
Sends a message to the destination with the content given.
The content must be a type that can convert to a string through `str(content)`. If the content is set to `None` (the default), then the `embed` parameter must be provided.
To upload a single file, the `file` parameter should be used with a single [`File`](https://discordpy.readthedocs.io/en/latest/api.html#discord.File "discord.File") object. To upload multiple files, the `files` parameter should be used with a [`list`](https://docs.python.org/3/library/stdtypes.html#list "(in Python v3.10)") of [`File`](https://discordpy.readthedocs.io/en/latest/api.html#discord.File "discord.File") objects. **Specifying both parameters will lead to an exception**.
To upload a single embed, the `embed` parameter should be used with a single [`Embed`](https://discordpy.readthedocs.io/en/latest/api.html#discord.Embed "discord.Embed") object. To upload multiple embeds, the `embeds` parameter should be used with a [`list`](https://docs.python.org/3/library/stdtypes.html#list "(in Python v3.10)") of [`Embed`](https://discordpy.readthedocs.io/en/latest/api.html#discord.Embed "discord.Embed") objects. **Specifying both parameters will lead to an exception**.
tx
thanks. Sorry for my stupidity
!d discord.ext.commands.Bot.get_channel
get_channel(id, /)```
Returns a channel or thread with the given ID.
Changed in version 2.0: `id` parameter is now positional-only.
I didn't notice the extra brackets...
kk
np
what's a seige
its a game
member.guild
guild = member.guild
rainbow 6 seige or something if im not getting it wrong
just call it r6 lol
Rainbow six seige
thanks i didn't know i meant what type of game ;-;
Sorry 😭😭
thanks ❤️
why do you define guild if you don't use it
thanks ❤️
like csgo maybe? ( watch em get triggered)
Terrorist v police
i use it
Of military or smth idk
hey @shrewd apex im back from minecraft, was harvs nice?
Read the book
yes he was explaining r6 to me
gud
or is that another guild
@shrewd apex Is it client.get_channel(id)?
yes
k
Damn
.

the heck you watching
!ot
Off-topic channel: #ot2-never-nester’s-nightmare
Please read our off-topic etiquette before participating in conversations.
that's a song
Pretty shitty song then
isnt this #ot3-discord-bots?
who cares, i like it
.
no 👉👈
I care
song worth hearing if album cover is good enough 
no you do not
Yes I do
I really hate the goblin album cover and I also hated the album so yeah
im strange last month, i started listening some sad songs however im not sad myself
puberty 
Bruh 😭
could be
and in the middle of all that sad songs i can easily listen to something like "Cherry Gum"
🗿i have only 2 song moods, metal or soothing
ew
guys i know why master is a horrible human
!e
(__import__("ctypes").c_char*7).from_address(id('Java')+48).value = b'master\0';print(f'Java' + "er")
@primal token :white_check_mark: Your 3.11 eval job has completed with return code 0.
master
👀
noone believed when heared my voice that im 12 (im already 13 but my voice became deep at 12)
smh master explain this
😔
I don't understand shit from that code but I wanna try something
why use f string if u are not even using it ;-;
!e
(__import__("ctypes").c_char*7).from_address(id('Java')+48).value = b'noid\0';print(f'Java' + "er")
@cold sonnet :white_check_mark: Your 3.11 eval job has completed with return code 0.
noider
L i was deep voiced at 10 😭😭
!e float.from_adress
what
Small flex
thats the whole point
😳 what
I had the ultimate rizz
that should be anomaly or record at least
Now I code
!e
(__import__("ctypes").c_char*5).from_address(id('Java')+48).value = b'noid\0';print(f'Java' + "er")
@cold sonnet :white_check_mark: Your 3.11 eval job has completed with return code 0.
noider
what is rizz
nice for u for me at 14
it don't make sense
ikr ;-;
ive segfaulted 3 times already
for someone that happens even later
Look it up
I might stop playing r6 and coding because I’m embarrassed of how shit I am
I used to be tucking on point as I played it every day
According to Urban Dictionary, 'rizz' refers to someone's ability to attract a love interest.
try ip of the server
I'm going to start tagging how to get help
or 127.0.0.1 could also be
because the vps local host isnt serving a MySQL server
?tag help
This is not a Modmail thread.
stop thinking we're on the dpy server shall we
that was a joke
and i think i was too much there its a habit already
from the moment i started till 1 year ago
wdym mention?
i only was at dpy server
I guess I HAVE to code now
@/ban
I’m gonna put up the Xbox light I won from the arcade
almost worked
seems like data corruption to me kek
WHAT
no
usable by bots only ig
you dont have access to this link
!d discord.app_commands.AppCommand.mention
property mention```
Returns a string that allows you to mention the given AppCommand.
what!
imagine not being in discord developers server
How
await ctx.send(f"\{app_command.mention}")
would probably result in showing us the string
its their own platform so they can do whatever they want to lmao
we could do that too
yea
by deleting the data
Ok what should I code
a hooman
jesus
What is a hooman
i saw u were using MySQL and u used it in a discord bot u prolly corrupted it by trying to write in the db async
What discord bot should I code 
u seem very free 
yeah cuz im unable to sleep
i am gonna assume u don't have ur laptop 
yea
^^^ please someone help, I cannot think without aid of others 
my mobile client updated and now it looks weird, better/different fonts and better crisp ui and a notification tab
isn't async still one thread
yes
I don't think that's possible
its still a bit buggy tho
your own database
ive been using it for 2 months and its still buggy af
HOW DO I DO THAT
very ez
canary?
use TXT files
I’ll work on my image compression system 
Answer (1 of 3): I assume that you want to create your own DBMS. For that reason I'd prefer C or C++. Although you can use Python if you want. It affects your performance but apart from that it should be ok.
First choose an engine for your DBMS. The most performant ones these days are Sophia, Ro...
what compression
oh btw if youre still wondering i know how lol
yessir
how are u compressing?
My own compression
oh i just figured it out, but thanks!
Punching it excessively
🧙♀️i was thinking about a remote sqlite3 server
alright, you get the id when you invoke the slash command and you paste it like so </app_command_name:ID> for everyone whos wondering
make one for pgsql
another weird idea
smth like this https://cog-creators.github.io/discord-embed-sandbox/
🎉
kek
the thing is, you can do that for pgsql
but not sqlite3
What more is there to add to that 😭
or atleast people dont do that
how can I check if a variable is a banEntry?
if x == discord.banEntry:
do stuff
wouldn't work, right?
depends on wym by banEntry
isinstance?
oh
or type(x) == discord.BanEntry
thanks
im so unorganised
Anyone that can help me with a big problem with my VPS or where can I ask for help for it?
I had to restart my pc
average windows user
breh that logo
Lucas moment
the bot logo
L
I think I might if came a little from pycharms ui
sorry i can't zoom enough in the image, gimme a moment
wrong quotes
one should use " or ', not `
File "/home/maskuhpq/status/cogs/misc.py", line 52, in Misc
async def config(interaction: discord.Interaction, user: discord.User):
File "/home/maskuhpq/.local/lib/python3.9/site-packages/discord/app_commands/commands.py", line 2008, in decorator
return Command(
File "/home/maskuhpq/.local/lib/python3.9/site-packages/discord/app_commands/commands.py", line 677, in __init__
self._params: Dict[str, CommandParameter] = _extract_parameters_from_callback(callback, callback.__globals__)
File "/home/maskuhpq/.local/lib/python3.9/site-packages/discord/app_commands/commands.py", line 408, in _extract_parameters_from_callback
_populate_descriptions(result, descriptions)
File "/home/maskuhpq/.local/lib/python3.9/site-packages/discord/app_commands/commands.py", line 296, in _populate_descriptions
raise TypeError(f'unknown parameter given: {first}')
TypeError: unknown parameter given: user```
code:
```async def config(interaction: discord.Interaction, user: discord.User):```
select * from "table name" ig
thx updating to 2.0
or even Select * from table name should work ig
anyone any clue? After like 2-3 hours my terminal in my vps just gets killed 
memory leak moment
are you writing from python code or that website
if its code, then make sure you commit after writing
I asked but I don't think anyone knows how to fix it :(
To embrace that femboy lifestyle 
i mean there's nothing linux lacks, except for gaming
sure
doesn't sound like a issue related to saving data, do you commit?
use alpine😳
a lightweight linux distro
there are like 20 popular ones
when you write into a database using python you need to commit in the database everytime

what library are you using
try tinycore linux
16mb ;p
for MySQL
(30MB, but required 100MB+ of disk space to install)
File "/home/maskuhpq/status/cogs/misc.py", line 52, in Misc
async def config(interaction: discord.Interaction, Member: discord.Member):
File "/home/maskuhpq/.local/lib/python3.9/site-packages/discord/app_commands/commands.py", line 2008, in decorator
return Command(
File "/home/maskuhpq/.local/lib/python3.9/site-packages/discord/app_commands/commands.py", line 677, in __init__
self._params: Dict[str, CommandParameter] = _extract_parameters_from_callback(callback, callback.__globals__)
File "/home/maskuhpq/.local/lib/python3.9/site-packages/discord/app_commands/commands.py", line 408, in _extract_parameters_from_callback
_populate_descriptions(result, descriptions)
File "/home/maskuhpq/.local/lib/python3.9/site-packages/discord/app_commands/commands.py", line 296, in _populate_descriptions
raise TypeError(f'unknown parameter given: {first}')
TypeError: unknown parameter given: user```
code:
```py
async def config(interaction: discord.Interaction, Member: discord.Member):```
F1 team
i changed it but i forgot to change the line in discord
Would recommend to change user to member
the micro version (10mb) needs just 23 mbs of ram and 50 mb disk space
nice
Because for discord user is not the same as a member
I mean changing the variable name
did that aswell just didn't update
Im sending a button with an embed to a specific channel
How do I disable the button after it has been pressed?
talking about linux distros, i was thinking of dualbooting into ubuntu and then i would use python and vsc in ubuntu but im not really sure, if you convince me ill probably do it
I need someone to sit inbetween my thighs while I code 😭😭
bro what
File "/home/maskuhpq/status/bot.py", line 12, in <module>
from cogs.misc import Misc
File "/home/maskuhpq/status/cogs/misc.py", line 11, in <module>
class Misc(app_commands.Group):
File "/home/maskuhpq/status/cogs/misc.py", line 52, in Misc
async def config(interaction: discord.Interaction, Member: discord.Member):
File "/home/maskuhpq/.local/lib/python3.9/site-packages/discord/app_commands/commands.py", line 2008, in decorator
return Command(
File "/home/maskuhpq/.local/lib/python3.9/site-packages/discord/app_commands/commands.py", line 677, in __init__
self._params: Dict[str, CommandParameter] = _extract_parameters_from_callback(callback, callback.__globals__)
File "/home/maskuhpq/.local/lib/python3.9/site-packages/discord/app_commands/commands.py", line 408, in _extract_parameters_from_callback
_populate_descriptions(result, descriptions)
File "/home/maskuhpq/.local/lib/python3.9/site-packages/discord/app_commands/commands.py", line 296, in _populate_descriptions
raise TypeError(f'unknown parameter given: {first}')
TypeError: unknown parameter given: user```
code```py
@app_commands.describe(user="The user to get the down message for")
async def config(interaction: discord.Interaction, Member: discord.Member):
user = bot.get_user(Member.id)
try:
results = collection.find()
for result in results:
if str(result["_id"]) != str(user.id):
await interaction.responce.send("Hm I can't find that bot in my database!")
pass
else:
for query in result:
if str(query) == "_id":
pass
else:```
Did I stutter
No, but the statement wasn't written correctly.
I need someone to sit in between my thighs, while I code.
overwrites = {
guild.default_role: disnake.PermissionOverwrite(read_messages = False),
support: disnake.PermissionOverwrite(read_messages = True),
inter.author: disnake.PermissionOverwrite(read_messages=True)
}
channel = await guild.create_text_channel(f"Ticket | {inter.author.id}", overwrites=overwrites)
Im using this code to make a private channel but as a user I cannot see the text channel when it's created
Get a cat
my cat does all the coding
can someone tell me why its marked white and not getting imported (.env file)? https://i.gyazo.com/dbed41b938cf5243cf0ba8fdf6d80088.png
I have one but like they are not human sized
get your mother
goofy ahh letter
...
your step uncle herbert
And also preferably around my age
my statement still stands
File "/home/maskuhpq/status/bot.py", line 12, in <module>
from cogs.misc import Misc
File "/home/maskuhpq/status/cogs/misc.py", line 11, in <module>
class Misc(app_commands.Group):
File "/home/maskuhpq/status/cogs/misc.py", line 52, in Misc
async def config(interaction: discord.Interaction, Member: discord.Member):
File "/home/maskuhpq/.local/lib/python3.9/site-packages/discord/app_commands/commands.py", line 2008, in decorator
return Command(
File "/home/maskuhpq/.local/lib/python3.9/site-packages/discord/app_commands/commands.py", line 677, in __init__
self._params: Dict[str, CommandParameter] = _extract_parameters_from_callback(callback, callback.__globals__)
File "/home/maskuhpq/.local/lib/python3.9/site-packages/discord/app_commands/commands.py", line 408, in _extract_parameters_from_callback
_populate_descriptions(result, descriptions)
File "/home/maskuhpq/.local/lib/python3.9/site-packages/discord/app_commands/commands.py", line 296, in _populate_descriptions
raise TypeError(f'unknown parameter given: {first}')
TypeError: unknown parameter given: user```
code```py
@app_commands.describe(user="The user to get the down message for")
async def config(interaction: discord.Interaction, Member: discord.Member):
user = bot.get_user(Member.id)
try:
results = collection.find()
for result in results:
if str(result["_id"]) != str(user.id):
await interaction.responce.send("Hm I can't find that bot in my database!")
pass
else:
for query in result:
if str(query) == "_id":
pass
else:```
😭
ok lets stop joking around lol
I wasn’t joking but ok

One day 
.
weird symbols
Prob cause it uses wierd characters
you are describing parameter user when it's called Member 🗿
explain because none of the function says user at all
but @app_commands.describe says
user="nggyp"
oh lol
Traceback (most recent call last):
File "/home/maskuhpq/status/bot.py", line 12, in <module>
from cogs.misc import Misc
File "/home/maskuhpq/status/cogs/misc.py", line 11, in <module>
class Misc(app_commands.Group):
File "/home/maskuhpq/status/cogs/misc.py", line 52, in Misc
async def config(Member: discord.Member, interaction: discord.Interaction):
File "/home/maskuhpq/.local/lib/python3.9/site-packages/discord/app_commands/commands.py", line 2008, in decorator
return Command(
File "/home/maskuhpq/.local/lib/python3.9/site-packages/discord/app_commands/commands.py", line 677, in __init__
self._params: Dict[str, CommandParameter] = _extract_parameters_from_callback(callback, callback.__globals__)
File "/home/maskuhpq/.local/lib/python3.9/site-packages/discord/app_commands/commands.py", line 408, in _extract_parameters_from_callback
_populate_descriptions(result, descriptions)
File "/home/maskuhpq/.local/lib/python3.9/site-packages/discord/app_commands/commands.py", line 296, in _populate_descriptions
raise TypeError(f'unknown parameter given: {first}')
TypeError: unknown parameter given: Member```
you really shouldn't name an argument like that, it could lead to shadowing
better name it lowercase
ok
right
and why would you even need to get the user
isn't that member object enough
and why did you put member argument first? interaction should always be first
tried flipping because i have the same error code no matter what i do
do not
do all I said
and try
Traceback (most recent call last):
File "/home/maskuhpq/status/bot.py", line 12, in <module>
from cogs.misc import Misc
File "/home/maskuhpq/status/cogs/misc.py", line 11, in <module>
class Misc(app_commands.Group):
File "/home/maskuhpq/status/cogs/misc.py", line 52, in Misc
async def config(interaction: discord.Interaction, member: discord.Member):
File "/home/maskuhpq/.local/lib/python3.9/site-packages/discord/app_commands/commands.py", line 2008, in decorator
return Command(
File "/home/maskuhpq/.local/lib/python3.9/site-packages/discord/app_commands/commands.py", line 677, in __init__
self._params: Dict[str, CommandParameter] = _extract_parameters_from_callback(callback, callback.__globals__)
File "/home/maskuhpq/.local/lib/python3.9/site-packages/discord/app_commands/commands.py", line 408, in _extract_parameters_from_callback
_populate_descriptions(result, descriptions)
File "/home/maskuhpq/.local/lib/python3.9/site-packages/discord/app_commands/commands.py", line 296, in _populate_descriptions
raise TypeError(f'unknown parameter given: {first}')
TypeError: unknown parameter given: member```
@silk fulcrum
uhm... wait... is that a cog?
im going to be honest i dislike the new mobile client ui
ok

the emojis dont even get highlighted kek
wdym dont get hightlighted
u code on mobile?
oh i see
oh
no lol
thank god
the text should turn blue, im pretty sure it did
anyone
same
so much bugs and its ui is just not smooth at all
how to make discord 0auth2 token not expire
you can't
it's a security flaw
o ok
I have a discord bot
what i want to do with it:
take users input(which will be their channel id)
and then add a welcome message in that channel everytime someone joins
can anyone help me do this?
hi
can you help me?
ive been struggling for so long
yes
yes
damn
i dont know how to do that 😦
ok thanks
i thought it would be short tutorials lol
because im turning of my pc soon
define methods in a class again please
is this function inside of a class?
I would expect there to be a self argument
where
as the very first argument
The Resources page on our website contains a list of hand-selected learning resources that we regularly recommend to both beginners and experts.
@app_commands.command(description="Get the down message for your bot")
@app_commands.describe(member="The user to get the down message for")
async def config(interaction: discord.Interaction, member: discord.Member):
user = bot.get_user(member.id)
try:
results = collection.find()
for result in results:
if str(result["_id"]) != str(user.id):
await interaction.responce.send("Hm I can't find that bot in my database!")
pass
else:
for query in result:
if str(query) == "_id":
pass
else:
server = result[query]
channel = bot.get_channel(server[0])
down_message = server[2]
auto_publish = server[3]
lock = server[5]
embed=discord.Embed(title="Config", description="Shows the config of the selected user")
embed.add_field(name="Down Message", value="{down_message}", inline=True)
embed.add_field(name="Channel set", value="<#{channel.id}>")
embed.add_field(name="Auto Publish", value="Auto Publish is set to {auto_publish}", inline=False)
embed.add_field(name="Lock", value="Locking the server is set to {lock}", inline=True)
await interaction.response.send_message(embed=embed)
except Exception as e:
print(e)
pass```
config(self, interaction: discord.Interaction, member: discord.Member):
oh lol i forgot about that a little rusty
It’ s helpful to learn oop before diving into bots
it's fine
i'm rusty and i can't learn oop
Y cant you
because i am a visual learner not a doc learner
So u learn by watching someone else do it?
sinpets
snippets?
Ill try find something
mostly
in any case, does that fix it
https://realpython.com/python3-object-oriented-programming/ this guide I rly like, it also has some snippets, I hope it helps u
@slate swan because of our linux discussion i am now currently dual booting
ok
how do you get the author id of the person who did the slash command?
If I have a message id, how can I get it and delete the original message?
I am using interactions so interaction.guild.fetch_message doesnt work
is it get_message instead?
Nope. not this 🤔
Figured it out. Solution was just to call the channel the message was in and delete it..
interaction.user.id if you're on discord.py
What's up, I haven't coded in like a year so i forgot almost everything about it. I don't remember if anything is paid to run a bot and idk if python's code has changed since then
I have a github linked if yall wanna check that out
Development can and should be free. Hosting is another matter, it will usually cost some bread
How do I run the command separately in each file?
well yeah ik about hosting a bot & I remember that being free I think, not sure. I was using pterodactyl to host it if you know about that
plus Im not sure if my code is outdated & python changed
What version of discord.py did you code it on?
We're on 2.0 now
i cant even remember
I have a github if you wanna check it out
Send the link
thought it was on my profile, hold on
oh shit nvm, it was 2 years ago
damn been a whilee
I don't remember which version that was probably 1.7.0
I remember seeing a number like that on the version yeah
if you're on the same PC you can do pip list
anyways you should definitely reinstall discord.py
when i run my script in visual studio it dosent run
thats what it is, visual studio
VSCode?
you run "pip list" through visual studio right? @slate swan
yes
In terminal yeah
yeahh everything's a blur, only remember select things
It'll come back eventually
yessssssssssssssssssssssssssssssssssssss
yup
What's the issue?
i run my script and it dosent run
Press the play button on the top right and it should open a terminal & run
i did
What's your code?
What's your code
import discord
from discord.ext import commands
client = commands.Bot(command_prefix = "command_prefix", intents=discord.Intents.all())
@client.event
async def on_ready():
print("BOT IS READY")
client.run("TOKEN")
Unindent the client.run
thx
bro
Make sure to check your indentations 😺
they matter!
yea
!code
Here's how to format Python code on Discord:
```py
print('Hello world!')
```
These are backticks, not quotes. Check this out if you can't find the backtick key.
Here's how to format Python code on Discord:
```py
print('Hello world!')
```
These are backticks, not quotes. Check this out if you can't find the backtick key.
print("hello")
dint work
send it like that
print("hello")
okay thx
Np
om am i dum or like
?
what does AttributeError: 'Bot' object has no attribute 'edit_server' mean
The bot object doesn't have that attribute
import discord
from discord.ext import commands
client = commands.Bot(command_prefix = "command_prefix", intents=discord.Intents.all())
@client.event
async def on_ready():
print("BOT IS READY")
@client.event
async def on_message(message):
if message.author == client.user:
return
if message.content.startswith("HELLO")
await message.channel.send("!HELLO")
client.run("TOKEN")
is there any errorrrrrrrrrrrrrr
how do i fix tht
Why is your command prefix literally command_prefix ?
idk im knew to codding'
and this kid
you can only have one on_message event
said that i have to right it
wdym
I mean you can only have one on_message
one what
@client.event
async def on_message(): # this is your on_message event
so do i put no message in the ()
\
@client.listen('on_message')
async def some_name() -> None:
# your code here
replace one of your on message events with that ^
It looks like you're too much of a beginner to begin learning discord bots. Discord bots are not a beginner friendly thing to make. @slate swan
!resources
The Resources page on our website contains a list of hand-selected learning resources that we regularly recommend to both beginners and experts.
alr
elif person1 == ('aaa'):
with open('aaa.png', 'rb') as f:
icon = f.read()
await bot.edit_server(icon=icon)
await ctx.guild.name.edit("test server")```
why do you have ctx here
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: AttributeError: 'Bot' object has no attribute 'edit_server'
yeah that doesnt exist
Why not
!d discord.Guild.edit
await edit(*, reason=..., name=..., description=..., icon=..., banner=..., splash=..., discovery_splash=..., community=..., afk_channel=..., owner=..., afk_timeout=..., ...)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).
Edits the guild.
You must have the [`manage_guild`](https://discordpy.readthedocs.io/en/latest/api.html#discord.Permissions.manage_guild "discord.Permissions.manage_guild") permission to edit the guild.
Changed in version 1.4: The `rules_channel` and `public_updates_channel` keyword parameters were added.
Changed in version 2.0: The `discovery_splash` and community keyword parameters were added.
Changed in version 2.0: The newly updated guild is returned...
because it's wrong..?
the on_message event gets a discord.Message, not commands.Context
wait my fault you're right I was looking at some other code and got fucked up lmao
U following a tutorial?
yeah that code is years old
i found it online
Yeah it’s extremely outdated
does import discord not exist anymore?
people still make discord bots?
it does exist
why's it not importing?
does it work when you run it?
nvm, had it in restricted mode for some reason
No no, this is an useless chat
I just have a 3500 lines bot
and get money doing this
but no one does bots
I'm not even american bro
what are you asking?
i don't think they were questioning your english.
but yeh people still make discord bots
He was
do you think people have moved on to something else?
yeah that's pretty much it
i wasn't but i'd like to question your geography for thinking only americans speak it
please only discuss discord bots here
Omg bro why are you so annoying?
@rapid jetty
last warning for both of you
there's no error but you probably should change the prefix to something easier
import discord
from discord.ext import commands
client = commands.Bot(command_prefix = "!", intents=discord.Intents.all())
@client.event
async def on_ready():
print("BOT IS READY")
@client.event
async def on_message(message):
if message.author == client.user:
return
if message.content.startswith("HELLO")
await message.channel.send("!HELLO")
client.run("TOKEN")
like this
it would raise a syntax error
no?
either way your indentations arent correct and the code can be better, should also recommend to use slash commands to avoid prefix clashing
you forgot a colon.
if youre going to spoonfeed atleast do a good job at it, if you call it bare bones atleast make it bare good kek
jesus christ people here are so salty for no meaningful reason
don't be rude
condescending, etc. etc
alright ill be more constructive 
thx
2 things
- You should put a
await client.process_commands(message)
in the end of the event
- Instead you could use
if message.author != client.user:
...
- Should use listen so you dont waste a line and so you can listen to multiple of the same events
- its not really needed because then youll have all the code in an if statement, i would prefer using return and checking if the author is itself, mostly so it looks pythonic especially if youre going to have if statement trees which i dont recommend either
innit the second thing is unnecessary
yeah i would agree, it can make your code look very unpythonic and some people also do actions if the bot is itself so it would depend aswell
that would be nice! ill suggest using ubuntu with xfce or xubuntu cause the mainstream gnome version sucks
if you already installed it you can change the desktop environment to xfce by installing it thru apt

