#discord-bots
1 messages · Page 695 of 1
Do persistent views
Link?
👌
I need some help with my slash command
every time i use the command that happens
Whats the error
@slash.slash(name="Message", description="Sending a message command.", options=[create_option(name="message", description="What the message is.", option_type=3, required=True), create_option(name="channel", description="What channel the message should be sent to.", option_type=7, required=True) ])
async def message(ctx, Message: str, channel: discord.TextChannel):
await channel.send(Message)
is the code for the command
how to get voice verified?
3rd party libs hurt my eyes
?
@client.event
async def on_ready():
db2 = sqlite3.connect("accessbeta.db")
cursor = db2.cursor()
cursor.execute(
"""CREATE TABLE IF NOT EXISTS accessbeta(
guild_id TEXT
)
"""
)
print("TESTING")
@client.command()
async def grantbetaaccess(ctx):
if ctx.author.id == 466528033638055936:
db2 = sqlite3.connect("accessbeta.db")
cursor = db2.cursor()
cursor.execute("SELECT guild_id FROM accessbeta")
result = cursor.fetchone()
if result == None:
sql = ("INSERT INTO accessbeta(guild_id) VALUES(?)")
val = (ctx.guild.id)
cursor.execute(sql,val)
db2.commit()
cursor.close()
print("successful")
Im so lost xd
I need help with sqlite3
raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: ValueError: parameters are of unsupported type```
show full tb
💀
anyone have any ideas 😅
what tb
I thought you meant table xd
oh wait
was that message for me 😂
yes
Ignoring exception in command grantbetaaccess:
Traceback (most recent call last):
File "C:\Users\LENOVO\AppData\Local\Programs\Python\Python38-32\lib\site-packages\discord\ext\commands\core.py", line 85, in wrapped
ret = await coro(*args, **kwargs)
File "C:/Users/LENOVO/Desktop/Coding -Winson/Python/NotaroBotBackupCode/testing discord bot/BotTesting.py", line 52, in grantbetaaccess
cursor.execute(sql,val)
ValueError: parameters are of unsupported type
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "C:\Users\LENOVO\AppData\Local\Programs\Python\Python38-32\lib\site-packages\discord\ext\commands\bot.py", line 939, in invoke
await ctx.command.invoke(ctx)
File "C:\Users\LENOVO\AppData\Local\Programs\Python\Python38-32\lib\site-packages\discord\ext\commands\core.py", line 863, in invoke
await injected(*ctx.args, **ctx.kwargs)
File "C:\Users\LENOVO\AppData\Local\Programs\Python\Python38-32\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: ValueError: parameters are of unsupported type
ok ok
Hey is events as powerful as using commands or should I prefer commands?
you should use commands for "commands" and events for other stuff
it's fixed, it just needed 1 comma on 1 place 😂
lmao
What's the difference?
well commands are more better than events (on_message) overall and they have more functionality
custom checks, cooldowns, unlimited arguments
Ohk... Thanks
👌
annndddd one problem takes it to another xd
@client.event
async def on_ready():
db2 = sqlite3.connect("accessbeta.db")
cursor = db2.cursor()
cursor.execute(
"""CREATE TABLE IF NOT EXISTS accessbeta(
guild_id TEXT
)
"""
)
print("TESTING")
@client.command()
async def grantbetaaccess(ctx):
if ctx.author.id == 466528033638055936:
db2 = sqlite3.connect("accessbeta.db")
cursor = db2.cursor()
cursor.execute("SELECT guild_id FROM accessbeta")
result = cursor.fetchone()
if result == None:
sql = ("INSERT INTO accessbeta(guild_id) VALUES(?)")
val = (ctx.guild.id, )
cursor.execute(sql,val)
db2.commit()
cursor.close()
print("successful")
@client.command()
async def checkifbeta(ctx):
db2 = sqlite3.connect ("accessbeta.db")
cursor = db2.cursor()
cursor.execute("SELECT guild_id FROM accessbeta")
result = cursor.fetchall()
print(result)
if ctx.guild.id in result:
print("Server is in Beta")
elif ctx.guild.id not in result:
print("Server aint in beta")
db2.commit()
cursor.close()
and this aint working as I thought xd, I dont get any errors
and when I run it I get this:
[('850356901232771082',)]
Server aint in beta
table:
wherein it should suppose to say "server in beta" since I did the command in that discord_server
so the problem is just gonna be at the command checkifbeta
make a list of the first element you get from the tuples of the result list
!e py result = [ ("id1" , ) , ('id2',)] first_element = [ e[0] for e in result] print(first_element)
@slate swan :white_check_mark: Your eval job has completed with return code 0.
['id1', 'id2']
and , compare it with str(ctx.guild.id) , since its a string type data
but the result is already:
[('850356901232771082',)]
so I should suppose add another guild.id for it to work?
nah , you cant check if the guild id is in the tuple directly
!e py if 1234 in [(1234,)]: print('works') else: print('doesnt work')
@slate swan :white_check_mark: Your eval job has completed with return code 0.
doesnt work
@client.command()
async def grantbetaaccess(ctx):
if ctx.author.id == 466528033638055936:
db2 = sqlite3.connect("accessbeta.db")
cursor = db2.cursor()
cursor.execute("SELECT guild_id FROM accessbeta")
sql = ("INSERT INTO accessbeta(guild_id) VALUES(?)")
val = (ctx.guild.id, )
cursor.execute(sql,val)
db2.commit()
cursor.close()
print("successful")
@client.command()
async def checkifbeta(ctx):
db2 = sqlite3.connect ("accessbeta.db")
cursor = db2.cursor()
cursor.execute("SELECT guild_id FROM accessbeta")
result = cursor.fetchall()
first_element = [e[0] for e in result]
print(first_element)
if ctx.guild.id in first_element:
print("Server is in Beta")
elif ctx.guild.id not in first_element:
print("Server aint in beta")
db2.commit()
cursor.close()
like this?
cause output is still
['850356901232771082', '837906907863580735']
Server aint in beta
wherein I messaged it in the server with that guild_id
table:
this is sqlite3 btw
use string form of guild id py if str(ctx.guild.id) in first_element
for both the if and elif statements
also , since you're just reading the database db2.commit() is not required there
ok it works, and also cannnn you pleasseee tell meeeee
|the [e[10] for e got me so confuse
about thisss what does it do 😂 Im so Black minded xd
oh ok ok
hmmmm even the cursor.close() or that's required?
its called list comprehension , result is already a list , what i am doing there is py e[0] for e in result , so basically it basically loops through all the elements inside the list result as e , and e[0] gives the first element of that element , its similar to py first_element = [] for element in result : first_element.append(element[0])
you should close it
hmmmm, ok ok THANKKK YOUUU SO MUCHHH
a small sidenote , sqlite3 is blocking so it may block your script at times you perform writing or reading operations , you can use the async version of sqlite3 instead
wait, theres async version of it?!
yea , the first link above is what ill recommend to use
wait is the module desame though?
the module is still sqlite3?
no need to import anything else
notice the awaits
you just need to change some parts of the code like import aiosqlite instead of import sqlite3 , and change sqlite3 to aiosqlite wherever you used it
and use await at some places
everything else remains same
ok so a good example for this is the time module and asyncio module
wherein time.sleep pauses the whole program while asyncio just pauses the command right?
omg my brainnnn
xd
yea exactly
wait sarthak
db2 = sqlite3.connect("accessbeta.db")
cursor = db2.cursor()
cursor.execute(
"""CREATE TABLE IF NOT EXISTS accessbeta(
guild_id TEXT
)
"""
)
``` this is at the on_ready part, hmm this without ``db2.commit()`` and ``cursor.close`` good?
cause the yt channel that I watched didnt really explained it well
can i send a message to a user when they leave ?
Not if the bot doesn't share any server(s)
depends on their settings, and if there's still a mutual server with the bot and the user
on_message() missing 1 required positional argument: 'message'
it needs commit and close because youre saving something
whenever you do any writing operation in the db , you need to commit it
and yea you should always close it when your work is done
async def on_message(ctx,message):
``` this is right ?
but i need ctx
U can instead do ctx = await bot.get_context(message) inside the on_message
But why would u need one? Since discord,Message had most (if not all) the attrs and methods commands.Context has
Like?
lemme count brb
@client.event
async def on_message(message):
await client.process_commands(message)
if message.author == client.user:
return
if message.content == "e":
ctx = await client.get_context(message)
if ctx.author.id in (499973767846428694 , 522748331575738368):
await message.add_reaction("😎")
else:
await message.add_reaction(random.choice(emoji))
Don't go on the count, just tell a single attr which can't be accessed with message but can be done with ctx @manic wing
U can do message.author.id too 
invoke invoked_with invoked_parents expected_error reinvoke invoked_subcommand command cog bot - crucial one
They are for commands only...
Yaaaa
yes, but on_message captures commands as well, hence why its useful to do ctx = await bot.get_context(message)
They are of no use in an on_message even bruv
Why do you need to process commands yourself tho? That's just gonna mess everything up ngl
discord.py does that for u, sooo, I don't think there's any need for those attrs, methods in an on_message lol
Can I get some more context? Wym by "compare shit"? What u referring to, here? 
mate i cba to continue this convo, apologies
Well I just wanted to know your PoV, that's it 
Could someone explain me the usage of intents?
!intent
Using intents in discord.py
Intents are a feature of Discord that tells the gateway exactly which events to send your bot. By default, discord.py has all intents enabled, except for the Members and Presences intents, which are needed for events such as on_member and to get members' statuses.
To enable one of these intents, you need to first go to the Discord developer portal, then to the bot page of your bot's application. Scroll down to the Privileged Gateway Intents section, then enable the intents that you need.
Next, in your bot you need to set the intents you want to connect with in the bot's constructor using the intents keyword argument, like this:
from discord import Intents
from discord.ext import commands
intents = Intents.default()
intents.members = True
bot = commands.Bot(command_prefix="!", intents=intents)
For more info about using intents, see the discord.py docs on intents, and for general information about them, see the Discord developer documentation on intents.
@commands.command()
@commands.is_owner()
async def remove_money(self,ctx,user:discord.Member,args):
try:
args = int(args) or "all"
if args == "all":
amount = await int(current_balance(ctx.author))
else:
amount = int(args)
except ValueError:
await ctx.send("The value is not an integer")
await remove_bal(user,amount=amount)
await ctx.send(f"Successfully removed {amount} :coin: from {user.mention}.")```
U should do args: int = "all" BTW
ohhh
user:discord.Member 
returns invalid input
yeah idc
Also u should do return await ctx.send(...) since that would stop the further code from running
Wym
@commands.command()
@commands.is_owner()
async def remove_money(self,ctx,user:discord.Member,args:int="all"):
try:
if args == "all":
amount = await int(current_balance(ctx.author))
except ValueError:
return await ctx.send("The value is not an integer")
await remove_bal(user,amount=amount)
await ctx.send(f"Successfully removed {amount} :coin: from {user.mention}.")```
like this?
Yea
k
my error handler returns invalid input
prolly because it isnt an integer
its "all"
Well you can't await an int
But u did it wrong
Yeah but await int(current_balance(ctx.author)) this is not the right syntax.
oh-
int(await function())
amount = int((await current_balance(ctx.author)))
ic
coroutine object cannot be transformed to an int.
two brackets after int?
is it a set?
Yes since we want to define the await .. func() first. Otherwise you will try to convert an coroutine object to an int.
i get the invalid input
tb?
Could you print the async function and see what it returns?
print?
lemme remove the error handler
better
@cloud dawn
File "C:\Users\sony\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\ext\commands\core.py", line 590, in transform
return await run_converters(ctx, converter, argument, param) # type: ignore
File "C:\Users\sony\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\ext\commands\converter.py", line 1183, in run_converters
return await _actual_conversion(ctx, converter, argument, param)
File "C:\Users\sony\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\ext\commands\converter.py", line 1095, in _actual_conversion
raise BadArgument(f'Converting to "{name}" failed for parameter "{param.name}".') from exc
discord.ext.commands.errors.BadArgument: Converting to "int" failed for parameter "args".
here
(self,ctx,user:discord.Member,args:int="all")
is this the ryt way?
you want args to be int yet you make it str
Make it a union
Are you using python 3.10?
from typing import Union
@commands.command()
@commands.is_owner()
async def remove_money(self, ctx, user: discord.Member, args: Union[int, str] = "all"):
No then i will use the old method.
i ll download 3.10
whats that
Union but faster.
cough i knew that
Well now it can be either a int or str.
yeah the union thing works
thx
so i installed 3.10, instead of Union what should i use and how?
@commands.command()
@commands.is_owner()
async def remove_money(self, ctx, user: discord.Member, args: int | str = "all"):
guys how to set an user limit in voice channel?
!d discord.VoiceChannel.edit
await edit(*, reason=None, **options)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).
Edits the channel.
You must have the [`manage_channels`](https://discordpy.readthedocs.io/en/master/api.html#discord.Permissions.manage_channels "discord.Permissions.manage_channels") permission to use this.
Changed in version 1.3: The `overwrites` keyword-only parameter was added.
Changed in version 2.0: Edits are no longer in-place, the newly edited channel is returned instead.
user_limit=...
thanks
could anybody suggest me whats wrong here?
indent?
yes
need more context, error
didn't understand
fixed it, thank you
??
eq typing 👀
Timezones if the main contributors are somewhere in between UTC+2 and UTC+4 maybe that's the reason
disnake owner
😳
Oh hi there
eq what's the cog's version of bot.user_command
Didn't know someone would recognize me
commands.user_command
hm
commands.user_command
Does this server have any other bots other than the python bot?
and it registers it but says it doesn't exist when I use it
#welcome yes
why's that🙁
This shouldn't happen
hm
Imma come back to bother you when I have more information about my own problem bruhkitty
Equenos is here?
Thats nice
!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.
???
????
!paste will be better than pasting here, thanks
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.
I am getting an attribute error when I use channel.send(). Is it not used anymore?
channel.send is used if you got the channel obj
I'm not too familiar with json, sorry
ok
Still used
I have made one using client.get but apparently it gives me an attribute error
mind to share the exact error?
Send the code
Maybe it sends an attr error
I'm talking of the traceback it should give
@client.event
async def on_message_edit(before, after):
channel = client.get_channel(id)
await channel.send("Something changed!")
Try sending the msg without a var
You can send a msg with .send since your getting a channel obj
await client.get_channel(id).send("msg")
AttributeError: 'NoneType' object has no attribute 'send'
wrong channel ID
the ID is wrong
timeouts are now live
hm?
thx everyone....it was a silly mistake
what
they should be global
Wym how to get them?
try updating ur discord
Just click on the user and Timeout
lmao
how can I update discord smh
Yo i got it lol
No I meant there shouldn't be any other issue except asking the way to do so
bruh.
There is no button like that for me
update on ur app store
Discord being Discord then
I have never done it, don't blame me it auto updates sometimes on my laptop
If I had to use this server wide along every channel, how would I do that?
it shows an option to update automatically
in where?
i hav2
I had some doubts
maybe, but my experiece is build into SQLite, I might have used that once
so first I make a client with MongoClient and if I have to upload multiple JSON's, then I can just do client[db].get_collection(...).insert_many()? @boreal ravine
the question thing?
or I gotta commit or smth too?
no, in between mentions and search bar
it shows a green sorta button
mind to help me out in ot, I'm dumb (pong on the channe you choice)
uh i've never used get_collection before and yes
is there any other button except those 2 on the right side of the search bar?
then how do u get the collection
ends to red line
then no update
client = ...
db = client["db"]
col = db["collection"]
``` but ig you could do your way
I don't think I have the time out here
Then could be it is rolling out slowly @tawdry perch
To prevent burden on their servers
btw, does disnake have the endpoint for it yet
yes, col.insert_many
Ah okay thanks
it just released
go on api docs maybe
I searched the docs and no I don't think it is there. I thought it came like day ago or smth
Hey!
can I get some example use of discord.Emoji ?
Doing something like this returns an error :
@commands.command()
async def remove_(self, ctx, *entered_emotes):
for i in entered_emotes:
i = discord.Emoji(i)
await i.delete()
something like this works btw :
@commands.command()
async def remove_(self, ctx, entered_emotes : discord.Emoji):
await entered_emotes.delete()
what is the error
well one error is this
I think in the first one you need to use a converter
Excited for it ngl
Ofc 2nd one wud work I mean u have to typehint that
nvrm
does anyone know how to make reaction roles cause everything i try doesn't work. i get no errors too
PS :- use PartialEmoji
Can refer u the docs if u want
What have u tried?
Smh why did u follow tutorials
U- u-copied code.....?
i don't think all of them had but
@dire foliou want roles by clicking on emojis posted on a message?
yes
i can give u my code
no i would never
Don't spoonfeed PPL please
i like being spoon fed
Don't follow tutorials and use on_payload_reaxtion etc
U Shudnt.
Imma be Outta this
Its not a thing to like upon
i used on_raw_reaction_add does that not work or smth
Yes u need to type hint partial emoji as well
U copied code ofc it widnt
@dire folio```py
@commands.Cog.listener()
async def on_raw_reaction_add(self, payload):
if payload.message_id == 123162581266:
if discord_helper.emoji_roles[payload.emoji.id]:
guild_id = 123456788
guild = self.bot.get_guild(guild_id)
member = payload.member
await member.add_roles(discord.utils.get(guild.roles, name=discord_helper.emoji_roles[payload.emoji.id]))
@commands.Cog.listener()
async def on_raw_reaction_remove(self, payload):
if payload.message_id == 123162581266:
if discord_helper.emoji_roles[payload.emoji.id]:
guild_id = 12345678789
guild = self.bot.get_guild(guild_id)
member = guild.get_member(payload.user_id)
await member.remove_roles(discord.utils.get(guild.roles, name=discord_helper.emoji_roles[payload.emoji.id]))
LOL
hello i have a question, how can i make this?
Anyone knows this error? (PyMongo)
Buttons and dropdowns
i did it myself 1 time and it worked but for some reason it stopped working
Yes!
I need ya. lemme finish typing please 😅
Buttons and drop down menus
How to fix it 
@coral harnesshttps://discord.com/developers/docs/interactions/message-components
https://github.com/discord/discord-interactions-python
Mind giving me a sec?
Sure
ok thanks
Wait... It worked!
https://stackoverflow.com/a/69614060/15264805
@prisma spoke this one helps, but mind sharing your solution too?
now I have timeouts
and i have another question. how can i make the stack of each statement?
@dire foliou will ened to edit that code a lil bit to fit your stuff
Theyre pretty nice ngl
like this
Just a sec
not the Buttons and drop down menus
i have never used the buttons/interactions myself. Just gave you links for further information.
ouh ok thanks
Are you using disnake?
typehint partial emoji as well? say I firstly wanted to see if an emoji is default or not so I want to use to partialemoji and then take actions (like remove) in the guild. So I wanted to get the arguments first before typehinting and pass it onto the discord.Emoji and discord.Partialemoji
I even tried something like this lol :
@commands.command()
async def remove_(self, ctx, entered_emotes):
for i in entered_emotes:
i : discord.Emoji = i
...
But like before doesn't work
Disnake has examples
he will need to edit code a bit 😉 so not fully usefull copy pasta code
@prisma spoke 👋
In short u need to retrace ur environment variable @maiden fable
Huh?
Convert it into an emoji and then check
oh yea, that was an typo. fixed that
Still does not work
how do i make my bot reply something in response to a msg,
like if it sees 'Hello' in chat i want it to reply 'World!' to it.?
Getting [SSL: CERTIFICATE_VERIFY_FAILED] on Python 3 on MacOS?
Navigate to your Applications/Python 3.X/ folder and double click Install Certificates.command
I use Windows tho haha
Don't worry I found the problem and fixed it (:
You can set up an on_message for that.
@bot.event
async def on_message(msg):
....
Um I meant that u need to convert the user text...to an emoji...
U can do so on making the params a list then indexing it and then u can do the necessary actions
Same ig i
Ohk
use the on_message param
thanks
msg.content here will contain the contents of the message that user has send in the channel @slate swan
oh, thanks again 🫂
@lunar quail
Sorry if it bothers a bit but could I get an example code snippet for that? Did not quite catch that.
Taking the parameter as "msg"
It wud be :msg.content[0]_msg.content[-1]
I am unable to explain atm as I am currently from phone
Ahh basically what do u wanna do? @lunar quail
And ?
I was just in search of an easier method
this is what I done earlier :
def get_emote(emote):
"""Returns True if emote is animated, returns False if not animated
Secondly returns the ID of the emote"""
# Animated emotes : <a:name:id>
# :foo:
# non-animated emotes : <:name:id>
# :bar:
try:
if emote[1] == "a":
is_animated = True
else:
is_animated = False
emote_id = regex.findall(r":[0-9]{1,}>", emote)
emote_id = int(emote_id[0][1:-1])
name = regex.findall(r":[a-zA-z0-9_]{2,}:", emote)
name = name[0][1:-1]
return is_animated, name, emote_id
except:
return None
It looked like alot of unnecessary work
When i looked at the docs I saw methods like name, id and is_animated available at ease
Can't help I don't know much bout discord.Emoji rn have to refer to the docs and can't from phone atm
if message.content == "EGGY":
await message.add_reaction("🇪")
await message.add_reaction("🇬")
await message.add_reaction("🇬")
await message.add_reaction("🇾")
```is there any 1 line way
So sorry
Seperate the emojis with a comma?
no works
trigger = "EGGY"
if message.content == trigger:
for i in trigger:
await.add_reaction(i)
Lxghtning do be helping
won't work
Uh?
yes
Haha I just meant that u started helping others even when u used to ask help from others till a few days ago.. Good to hear!
M just bored atm so yea
bru 🇪 not = e
Oh that was an emoji thing. This is is my POV lol
It looked like letters to me
does anyone know why I might be getting this error?
"await interaction.respond(content="Check dms for signup process")"): can't start new thread
do I need to do something with interaction after I respond? is it causing a unfinished thread?
which lib
same as me to
I have an idea hold on
Lmao a few days ago I didn't even know python smh I mean o did but not a lot and not well and was copying code but now I don't need to cuz I am able to make my own original code :P
But it's like shocking that u remembered that smh
There ur error is
after a while the bot will crash cause It can't start any more threads, but I'm only using asyncio and on_events to start a sequence of interactions
well I remember most of the people and their questions till a few days sooo
no error i want to make it in 1 line not use 100 lines
don't use discord-interactions. It is buggy. Use another lib
what others are there for python
U are tryn to add text in place of reactions and ur not even converting them to emojis smh
that use buttons
Disnake :)
I was bad af at that point but just needed to work on some things and now I can agree I am better and a.kot better infact than before :P
bru this is not text that all emojis, vs code make it look like text
sorry I'm using discord-components, not interactions
Sorry didn't get u?
cool!
Haha thanks
Soooo?
Gn
to_letter_emoji = {
letter : emoji for (letter, emoji) in zip(
[chr(n) for n in range(ord("a"), ord("z") + 1)],
[f":regional_indicator_{chr(n)}:" for n in range(ord("a"), ord("z") + 1)]
)
}
!paste dont mind, this is for me
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.
Took a bit long because I forgot dict comprehension
OMG why so complicated ;-;
what the heck u even doing 
Smart solution.
I would also do it like this.
Well not here.
discord tickets
what u need help with tho @livid fractal
No where, we don't even redirect to other sources regarding this.
@maiden fable
This is how you use it tho :
!e
to_letter_emoji = {
letter : emoji for (letter, emoji) in zip(
[chr(n) for n in range(ord("a"), ord("z") + 1)],
[f":regional_indicator_{chr(n)}:" for n in range(ord("a"), ord("z") + 1)]
)
}
trigger = "achxy"
for i in trigger:
print(to_letter_emoji[i])
@maiden fable u got any idea?
hold up wheres the eval bot
I didn't see it, sorry. Lemme see @quick gust
stop it
Delete it plz
alr np
I don't understand views that well so please excuse
its made on python
so idk im scred man
BRO BROOOOOOOOOO
u forgot to supply the bot arg while sending lol
ooh
await ctx.reply(embed=embed, view=PingRef(ctx.bot))
wait, LMAO
try this (:
alr
that not e g y its emojis
Was a simple Python Mistake haha
Heres your exact solution :
to_letter_emoji = {
letter : emoji for (letter, emoji) in zip(
[chr(n) for n in range(ord("a"), ord("z") + 1)],
[f":regional_indicator_{chr(n)}:" for n in range(ord("a"), ord("z") + 1)]
)
}
trigger = "eggy"
if message.content == trigger:
for i in trigger:
print(to_letter_emoji[i])
imagine spoonfeeding
works tysm! I feel kinda dumb tho now lmao
🥣
Haha

reaction should be added properly
What’s this supposed to do?
since it's a default emoji
Convert normal letters into discord 🇧 locks
Oh ok
🇱 🇴 🇱
okay so does anybody know command ideas for a voicechannel bot
no alphabet cant react
Shuffle, shuffles all the users in all voice channels across all voice channels.
lemme try run this locally. wait.
that's a troll command

hm
huh
if message.content == "e":
to_letter_emoji = {
letter : emoji for (letter, emoji) in zip(
[chr(n) for n in range(ord("a"), ord("z") + 1)],
[f":regional_indicator_{chr(n)}:" for n in range(ord("a"), ord("z") + 1)])
}
trigger = "eggy"
if message.content == trigger:
for i in trigger:
await message.add_reaction(to_letter_emoji[i])
indentation
await message.add_reaction(":regional_indicator_a:")
discord.errors.HTTPException: 400 Bad Request (error code: 10014): Unknown Emoji
😣 😣 😣 😣 😣
Missing an :
what's wrong there? will be very grateful for help
!charinfo 🇦
\U0001f1e6: REGIONAL INDICATOR SYMBOL LETTER A - 🇦
\U0001f1e7: REGIONAL INDICATOR SYMBOL LETTER B - 🇧
holy shit
-_-
Eh
lemme dump this onto discord and get the unicode thing myself
btw fyi you can add an backslash to an default discord emoji and get it's "your version"
idk how to explain that but
dosnt just letter add on regional_indicator_<letter_here> work?
that used to be the solution I provided earlier
it apparently does not work for reactions
so here's my solution :
regional_emojis = """\🇦
\🇧
\🇨
\🇩
\🇪
\🇫
\🇬
\🇭
\🇮
\🇯
\🇰
\🇱
\🇲
\🇳
\🇴
\🇵
\🇶
\🇷
\🇸
\🇹
\🇺
\🇻
\🇼
\🇽
\🇾
\🇿"""
letter_to_block = {
letter : emoji for (letter, emoji) in zip(
[chr(n for n in range(ord("a"), ord("z") + 1))],
[n[1] for n in regional_emojis.splitlines()]
)
}
oh wow that looks so overdone with zip and all 😄
🥣
so cant you juse do \letter then?
Doing that 26 times would take all day
why?
we can automate a 10 min task in 10 hrs ya know
emo = "<:regional_indicator_{}:>".format(letter.lower())
finally 😭
That's because I need an tuple of eng letters and that regional emote thingy
why why the hell \
;-;
aiohttp.client_exceptions.ClientConnectorError: Cannot connect to host discord.com:443 ssl:default [Temporary failure in name resolution]
why
ur banned - nah jk i donno never had issue with discord.com ssl
@slate swanare u using Pythonganywhere?
show your code
Network issue
@tacit horizon looks like we are done
WOW
def get_block(letter_input : str):
empt_str = ""
regional_emojis = """\🇦
\🇧
\🇨
\🇩
\🇪
\🇫
\🇬
\🇭
\🇮
\🇯
\🇰
\🇱
\🇲
\🇳
\🇴
\🇵
\🇶
\🇷
\🇸
\🇹
\🇺
\🇻
\🇼
\🇽
\🇾
\🇿"""
letter_to_block = {
letter : emoji for (letter, emoji) in zip(
[chr(n) for n in range(ord("a"), ord("z") + 1)],
[n[1] for n in regional_emojis.splitlines()]
)
}
for n in letter_input:
empt_str += letter_to_block[n]
return empt_str
The problem is that...
this isn't clean
I will fix that tmrw
stopid today
ur r OP
I'll see what i can do.

what's wrong there?
Functions are op trust me
from discord.ext import commands
bot = commands.Bot(command_prefix="..")
def get_block(letter_input : str):
empt_str = ""
regional_emojis = """\🇦
\🇧
\🇨
\🇩
\🇪
\🇫
\🇬
\🇭
\🇮
\🇯
\🇰
\🇱
\🇲
\🇳
\🇴
\🇵
\🇶
\🇷
\🇸
\🇹
\🇺
\🇻
\🇼
\🇽
\🇾
\🇿"""
letter_to_block = {
letter : emoji for (letter, emoji) in zip(
[chr(n) for n in range(ord("a"), ord("z") + 1)],
[n[1] for n in regional_emojis.splitlines()]
)
}
for n in letter_input:
empt_str += letter_to_block[n]
return empt_str
@bot.event
async def on_ready():
print(f"Sucessfully logged in as {bot.user}")
@bot.event
async def on_message(msg):
trigger = "eggy"
if msg.content == trigger:
emoji_block = get_block(trigger)
for each_emoji in emoji_block:
await msg.add_reaction(each_emoji)
bot.run("TOKEN")
you can change eggy to any lowercase eng letter
even repeating ones are fine
like ababca
Do you guys help with discord-ext-menus?
why's it so overcomplicated lmao
just make a dictionary
It is literally a dictionary
with keys a,b,c,d
I have no idea how it'll get any simpler than that
def get_block(letter_input: str) -> str:
reg_emojis = "\🇦|\🇧|\🇨|\🇩|\🇪|\🇫|\🇬|\🇭|\🇮|\🇯|\🇰|\🇱|\🇲|\🇳|\🇴|\🇵|\🇶|\🇷|\🇸|\🇹|\🇺|\🇻|\🇼|\🇽|\🇾|\🇿"
letter_to_block = {
letter: emoji for (letter, emoji) in zip(
[chr(n) for n in range(ord("a"), ord("z") + 1)],
[n[1] for n in reg_emojis.split('|')]
)
}
letter_to_block[' '] = ' '
return "".join([letter_to_block[n] for n in letter_input])
``` shorten function and added space so it doesn't crash.
regionals = {
'a': '🇦', 'b': '🇧', # etc
}
# Somewhere in ur command
for letter in message.content:
emoji = regionals.get(letter)
if emoji is not None:
await message.add_reaction(emoji)
Thanks! that's so much cleaner !
why are y'all using so many functions and methods and stuff 
Much cleaner
yea good luck typing all the english alphabets
you literally typed all the english alphabet already 💀
that's the best part
i didn't
¯_(ツ)_/¯
It was generated with another code
Yaaa
it was explained here
w this code
\U0001f1e6: REGIONAL INDICATOR SYMBOL LETTER A - 🇦
Maby a generator with the unicode?
EXACTLY WHAT I WAS THINKING
You are not allowed to mix f strings and unicode though it's a bit weird.
I have no idea how to "get the next value" of a unicode char tho but it seemingly does have a pattern
(it does obv)
Well you would need to build the char recognition first..
regionals = {
'a': '🇦', 'b': '🇧', 'c': '🇨',
'd': '🇩', 'e': '🇪', 'f': '🇫',
'g': '🇬', 'h': '🇭', 'i': '🇮',
'j': '🇯', 'k': '🇰', 'l': '🇱',
'm': '🇲', 'n': '🇳', 'o': '🇴',
'p': '🇵', 'q': '🇶', 'r': '🇷',
's': '🇸', 't': '🇹', 'u': '🇺',
'v': '🇻', 'w': '🇼', 'x': '🇽',
'y': '🇾', 'z': '🇿'
}
# Somewhere in ur command
for letter in message.content:
emoji = regionals.get(letter.lower())
if emoji is not None:
await message.add_reaction(emoji)
*also, sorry if I sounded rude earlier, I was tired
\U0001f1e6 + 1 = b
there u go 😌
This is our code but with extra steps.
that'd do? 
this is all u need, no extra functions or some bs like that
Hell no lol
more function calls = slower
*lot less steps
Where did you get this info from 
my brain
millisecond difference here even if there is one.
think about it, a function call takes time, the more function calls u have, the more it'll take
Functions are just as fast, it just looks cleaner and it destroys repetitive code.
this ^^^
This makes no sense.
it does tho?
It's async code..??
There's no need to, we can directly pass unicode into add_reaction as a string.
the function itself isn't 
hey, so im making a trace back feature, everything works fine besides when it tries inputing the key it goes as a '' string not a no '' int.
server = ctx.guild
letters = string.ascii_letters + string.digits
trace_code = ''.join(random.choice(letters) for i in range(30))
BotCache.errors[trace_code] = {'server': server.id, 'error': error}```
anyone know a fix?
.join takes an iterable which contains string objects, not ints
FINALLY THAT WHAT IWAS THINKING
you can't concatenate a string to an int
str(random.choice(letters))
This is the same as ours but with more effort 
hm ok lt me try
and less complicated
no your big brain stuffs
*and less lines of code
Have to agree on the complexity
i could one-line it
you really don't have to go out of your way to make a simple regional emoji lookup look that complex
same
then again, no point in making it complex or bothering with it too much
can u send full code pls
?
if i really have to spoonfeed you that much then i'm not gonna help u any further 💀 🖐️
Can you send me code for discord bot
no, can you? 
;-;
when i tried doing this, str(random.choice(letters) for i in range(30)) it didnt give the 30 charector thing, it gave a weird error instead
BotCache.errors[tc] = {'server': server.id, 'error': error}```
that is not what i told you to do
Send me code for bot like carl
send me the code for bot like shitmee6
what is token
It is sort of like the password for your bot
your bot logs into discord with it'
wait wait
you can find it under discord dev portal -> bots
i was joking
i took out the for i in it, but it just returns one random letter, i dont want that
.join([str(random.choice(letters)) for i in range(30)])
uh
can't disagree
I mean your name is java lol
after that u used @client.command() ?
yea you can use that if you want commands after that
also some rare cases it doesn't like that
and you have to do await bot.load_command()
i did ''.join([int(random.choice(letters)) for i in range(30)]) but it still goes in the dict with ''
i need it without that, sorry for being annoying
or you can avoid all that headache and use a listener
dude, where the fuck did that int come from
can u really not even copy paste
import discord as disnake
import disnake as nextcord
import nextcord as discord
bot = discord.ext.commands.Bot(command_prefix="shit")
@bot.cmd;
With def as async:
function("ping"): respond_with("shitmee6 ping is 00")
disnake.run(bot("ieidhhoao2937739r8y37736372jdhdkskw"))
pls give me example ;-;
i switched it from str
both not working
actually, i'm not gonna say anything any further, don't want any mods muting me or sum shit, and i'm not gonna help u anymore with this basic thing
it worked with str, ik bc it worked for me
!e ```py
print(''.join([str(i) for i in range(30)]))
replace things under @bot.event decorator with this
@bot.listen("on_message")
async def check_if_contains(msg):
...
looks good ngl 
@cloud dawn :white_check_mark: Your eval job has completed with return code 0.
01234567891011121314151617181920212223242526272829
Aww, thanku
you don't actually need this but you can
it's an cooler on_message which you don't need to load
......................................................................................;
Could we also code sexy code, cool code is pretty standard these days.

do any of y'all have any good ideas for some command which can earn my members some coins? i have a game where u can collect characters that have different hp/dmg, but currently the only source of income are the daily and the fights they can do with each other with their characters, and i basically need more 
!e
import random
print(''.join([str(random.choice(letters)) for i in range(30)]))
@lunar quail :x: Your eval job has completed with return code 1.
001 | Traceback (most recent call last):
002 | File "<string>", line 2, in <module>
003 | File "<string>", line 2, in <listcomp>
004 | NameError: name 'letters' is not defined
outside thats shyhe
Be in a voice channel for longer than 10 min.
bro what 😭
lol
ig i did wrong to ask y'all then 💔
do you just want to create an 30 letter string which is an mix of smaller letter upper letter and numbers ?
!e
import random
letters = string.ascii_letters + string.digits
tc = ''.join([str(random.choice(letters)) for i in range(30)])
print(tc)
@lime trench :x: Your eval job has completed with return code 1.
001 | Traceback (most recent call last):
002 | File "<string>", line 2, in <module>
003 | NameError: name 'string' is not defined
yes
and not go in the dict as a string aka ''
!e ```py
import random
import string
letters = string.ascii_letters + string.digits
tc = ''.join([random.choice(letters) for i in range(30)])
print(tc)
@slate swan :white_check_mark: Your eval job has completed with return code 0.
03zt6sNJ4hGNSAH9d3J5OPBXg15R6I
but it goes in the dict with ''
that's ur fault
What do you got so far?
only the daily command which has streaks, and from fights, although i've already said this in the message which you'd know... if... yk... you would've read it all 
Could you please calm down on the gifs?

!mute 718052323909173279
:incoming_envelope: :ok_hand: applied mute to @slate swan until <t:1640030351:f> (59 minutes and 59 seconds).
ty 😌
anyways back to this, anyone got any ideas 
!ban 718052323909173279 joined just to spam
:incoming_envelope: :ok_hand: applied ban to @brazen garden permanently.


😌
sorry for the delay I went for a snack
also heres the code
import random
def random_string(char_length : int):
empt_list = []
stuff = [chr(n) for n in range(ord("a"), ord("z") + 1)]
stuff += list(map(lambda x: x.upper(), stuff))
stuff += [str(n) for n in range(0, 10)]
for _ in range(char_length):
empt_list.append(random.choice(stuff))
return "".join(empt_list)
print(random_string(30))
!e
import random
def random_string(char_length : int):
empt_list = []
stuff = [chr(n) for n in range(ord("a"), ord("z") + 1)]
stuff += list(map(lambda x: x.upper(), stuff))
stuff += [str(n) for n in range(0, 10)]
for _ in range(char_length):
empt_list.append(random.choice(stuff))
return "".join(empt_list)
print(random_string(30))
@lunar quail :white_check_mark: Your eval job has completed with return code 0.
vQD6cl6IKuonwFEddcCheUAUOg6e2A
Also don't make secret tokens with this
or for anything sensitive
just use secrets module for anything sensitive
tad bit shorter :
def random_string(char_length : int):
stuff = [chr(n) for n in range(ord("a"), ord("z") + 1)]
stuff += list(map(lambda x: x.upper(), stuff))
stuff += [str(n) for n in range(0, 10)]
return "".join([random.choice(stuff) for _ in range(char_length)])
same thing
here's even a shorter method
!e ```py
import secrets
char_lenght = 18
print(secrets.token_urlsafe(char_lenght))
@slate swan :white_check_mark: Your eval job has completed with return code 0.
-1qzgDfky4Ki-1uGEzH5eDSQ
How do I use asyncio.Event to create a custom event and handle the event using on_custom_event method?
@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")
!d discord.ext.commands.has_any_role for multiple roles
@discord.ext.commands.has_any_role(*items)```
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 **any** of the roles specified. This means that if they have one out of the three roles specified, then this check will return True.
Similar to [`has_role()`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.has_role "discord.ext.commands.has_role"), the names or IDs passed in must be exact.
This check raises one of two special exceptions, [`MissingAnyRole`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.MissingAnyRole "discord.ext.commands.MissingAnyRole") if the user is missing all roles, 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 [`MissingAnyRole`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.MissingAnyRole "discord.ext.commands.MissingAnyRole") 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")
i can't invite any bots to my server ||is this the wrong place for this kinda question?||
No this is discord bots
This is exactly the place
This is the equivalent of a cop passing you while you're 5 km above the speed limit, you know you won't get arrested but you're scared af anyway
Discord has released timeouts but I don't see the docs on it on the developer portal, are they not there yet or they won't even be supported for bots?
I wasn't aware of this, I might have to review my sources
Like seems there's no timeouts
!d asyncio.TimeoutError
exception asyncio.TimeoutError```
The operation has exceeded the given deadline.
Important
This exception is different from the builtin [`TimeoutError`](https://docs.python.org/3/library/exceptions.html#TimeoutError "TimeoutError") exception.
I didn't mean this
New discord feature
Won't be supported by main library as they ceased development but I could do them with API
@client.event
async def on_member_join(member):
if member.dm_channel == None:
await member.create_dm
await member.dm_channel.send(embed=nextcord.Embed(description="Willkommen auf "+member.guild+"!").set_image(member.guild.icon.url))``` i dont know why the event doesnt trigger. i use nextcord
ok can i fix it with nextcord?
ok
ty
ok
unfortunally it still doesnt work
no
You got intents
yes
are you sure..? The only time that event wouldn’t get fired and a someone genuinely joins a server would be if they don’t have member intents.
Disnake :)
You get them enabled in your code?
wdym?
!intents
Using intents in discord.py
Intents are a feature of Discord that tells the gateway exactly which events to send your bot. By default, discord.py has all intents enabled, except for the Members and Presences intents, which are needed for events such as on_member and to get members' statuses.
To enable one of these intents, you need to first go to the Discord developer portal, then to the bot page of your bot's application. Scroll down to the Privileged Gateway Intents section, then enable the intents that you need.
Next, in your bot you need to set the intents you want to connect with in the bot's constructor using the intents keyword argument, like this:
from discord import Intents
from discord.ext import commands
intents = Intents.default()
intents.members = True
bot = commands.Bot(command_prefix="!", intents=intents)
For more info about using intents, see the discord.py docs on intents, and for general information about them, see the Discord developer documentation on intents.
ok
now it works ty
@client.event
async def on_message(message):
channels = client.get_channel(922437371130179584)
await channels.add_reaction('✅')
await channels.add_reaction('❌')
I want to make sure that when someone sends a message in channels that the bot adds a reaction but it doesn't work?
you can't add a reaction to an instance of discord.TextChannel...do you mean py @client.event async def on_message(message): channel = client.get_channel(922437371130179584) if message.channel.id == channel.id: await message.add_reaction('✅') await message.add_reaction('❌')
When i do that the bot is adding to every message that i send an reaction
O like that
what messages are you trying to react to?
It is just when a user send a message the code that you sent should work i think
how do i get the icon of a guild with nextcord?
nextcord has docs right?
ik but it doesnt work
i want to get the icon url in an on_member_join event thats my problem
When I do
await (client.get_user(321675286108307456)).send("hello!")
It is saying AttributeError: 'NoneType' object has no attribute 'send'
Even though it is a valid user id and the bot is sharing a server with the user
*dislash
Ok fixed the problem
had to use fetch_user
but why would get_user not work?
if bot.sup_role in member.roles or bot.team_role in member.roles or bot.admin_role in member.roles:
AttributeError: 'User' object has no attribute 'roles'```
How does this happen?
User is an object that represents the user itself, and isn't specific to a server. A discord user itself doesn't have any roles, you only attain roles in a server
so it's likely that member isn't an actual Member in a server, but a User in discord instead
how do i add kick command ?
can anyone helpp
@commands.command()
@commands.has_permissions(kick_members=True)
async def kick(ctx, member: discord.Member, *, reason=None):
await client.kick(member)
await ctx.send(f'User {member} has been kick')```
does this work
Hi i have a question I make a command and it doesn't work I get the error AttributeError: 'Member' object has no attribute 'timeout'
@client.command()
@commands.has_permissions(ban_members = True)
async def timeout(ctx, member : discord.Member, *, reason = None):
await member.timeout(reason = reason)
``` i tryed the new timeout thing
Is it possible to send ephemeral messages together with views and buttons?
what do you want to do with the timeout command ? since there is nothing called timeout for a member
u tryin to ban people?
is that a vc command or normal ?
can you join my server for 5 m?
cool, didn't knew when it was added
The new timeout feature is essentially a mute command
It also will kick people from stages/vc's and stop them from joining but most servers will usually have their muted role set up like that
It seems like Discord is trying to move away having people rely on bots to have a functioning server
bc some ppl cant code basically ^
Since discord.py is no longer being maintained updates will not be made to include new features
You'll need to use a fork if you want to use the new timeout feature
whats a fork?
how can i detect a nickname change?
!d discord.on_member_update
discord.on_member_update(before, after)```
Called when a [`Member`](https://discordpy.readthedocs.io/en/master/api.html#discord.Member "discord.Member") updates their profile.
This is called when one or more of the following things change:
• nickname
• roles
• pending...
mmm ty
i have an issue with this command ```py
for message in messages:
embedmsg = discord.Embed(description=f'-「{message.author.mention}」:\n {message.content}')
await channel.send(embed=embedmsg)```
it is a clear command and the log of the command is this:
like purge?
is there any way to make it compact in a big embed
yeah
then use await ctx.channel.purge(limit=limit)
limit = how many messages
thats not the point of my question tho :(
o
i need to know how to make the log, compact in a single embed
instead of having it all shattered around
well if you want to have another field you can do embedmsg.add_field(name="name", value="info", inline=True)
yeah i know that
to make embed big
what's messages?
You create a different embed for each message. You should instead add a field to a single embed for each message.
Create the embed first, then start the for loop.
@dapper cobalt
ohhh ok
ok im gonna sleep night
For clarification, it should be like that.
embedmsg = discord.Embed()
for message in messages:
embedmsg.add_field(name=message.author, value=message.content, inline=False)
await ctx.send(embed=embedmsg)
since discord.py is degrading, are there any simular or identical alternate librarys that operate in the same way?
!pypi disnake
does it work like discord.py
That's a fork of discord.py, means that it's the exact same.
oh wow tysm i was lil confused
now i understand loops better
ty
However, it's a maintained fork.
All you need to do is use disnake instead of discord.
gotchaa, so when i switch my import nothing will be broken
E.g. disnake.Embed() and not discord.Embed().
Just replace discord with disnake.
or import disnake as discord ?
Yes, that should work as well.
cool, thanks!
Loops are very important in Python, as well as really useful and time saving.
whats wrong with nextcord and all the other forks
That I love disnake.
I love it because its developer also created dislash, which saved me in some cases.
fair enough
!pypi dislash.py
this is the actual result
we can talk about it in #help-chili
@slate swan this help channel is occupied
please delete these messages and open a new channel
oh bruh
i am wrong lol
Wrong channel.
ahahahah sry im bit distracted
!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.
Yes, you pass an embed kwarg.
Very nice, just implemented timeout to my wrapper
how can i make this pattern?
do it
**__do it__**
ouhh
Yeah
ok thanks
https://gist.github.com/matthewzring/9f7bbfd102003963f9be7dbcf7d40e51
Those are some more markdown things you can do if you want them. You're able to combine multiple of them too.
thanks alot
No problem
whats the easiest way to send an image to a discord webhook ?
await send(content=..., *, username=..., avatar_url=..., tts=False, ephemeral=False, file=..., files=..., embed=..., embeds=..., allowed_mentions=..., view=..., thread=..., wait=False)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).
Sends a message using the webhook.
The content must be a type that can convert to a string through `str(content)`.
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.
If the `embed` parameter is provided, it must be of type [`Embed`](https://discordpy.readthedocs.io/en/master/api.html#discord.Embed "discord.Embed") and it must be a rich embed type. You cannot mix the `embed` parameter with the `embeds` parameter, which must be 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 to send.
Bit random, but wanted to share a new mute command using the new discord feature added https://gist.github.com/an-dyy/b8c81ce7f332d64e97519b07f95e76f0
im having some trouble, can you help?
data = {
"username": f"from: {datetime}",
"avatar_url": "url but its too long",
"embeds": [{
"title": f"{source}",
"file": f"a real file location dont worry its just long"
}]
}```
hi, i need some help to make my bot
<@&831776746206265384>
!ban 900031515587645451 nazi shit
:incoming_envelope: :ok_hand: applied ban to @candid jasper permanently.
any libraries for the new timeout feature yet?
what help
idts, you can use the discord developers docs tho
btw can i ask how you have the indicator 1, 2 3 on your codeblocks
Ah thanks for pointing that out forgot I modified my client
oh
I need to uninstall that
Mhm just added that to my API wrapper
was it difficult
Nope lol, super easy
You can just type python -m site into your terminal and it should show a list of directories
oh
👍
crap i dont actually understand this
i might screw up stuff so better not to risk
mmm
To explain it more, you edit it the same way you edit nicknames of a member
E.g requesting PATCH to the endpoint guild/guild_id/members/member_id
Then you just pass an isoformat timestamp inside of the data
hmm
in your wrapper, how'd i use this?
Just await Member.edit(timeout=datetime.datetime object)
oh
can i run fasapi and my discord bot simulatneously on my server
how to make it mention me, because it shown ids but not mentioning, working on discord.py
you cant mention in field name
oh so i only can shown the winner name?
ye
okie tq
what platform should I download to make a music bot
and what other things will I need
yes
okie
yo
i’m making a pack opening bot
like, you open a pack and get a character
i have the packs down
all i want to do now is make the bot save what a person gets from the pack into like a database sorta thing, where if you look in your inv it’s there
does anyone know how to do that?
You can use something like ```py
vc.play(discord.FFmpegPCMAudio(executable='C:/ffmpeg/bin/ffmpeg.exe', source='your_file.mp3'), after=lambda e: print('done', e))
to pipe audio into a voice channel defined by `vc`, but it's pretty complex @vague sentinel
ok
hello i have a problem with my bot, i try to change the prefix but dont change and have the default prefix
try stopping your bot
after you change the prefix
i tryed
then start the bot again
I was about to say, are you restarting your bot?
yes
interesting
🧢
same thing
did u save the file?
how are you restarting the bot
restart it after changing
yes
you have to save and restart it after every change you want to apply
control + c and python main.py
yess if you want i can share you screen
wait what
Are you trying to change the command prefix in a special event?
how i can do this
it should be working what the fuck is happening right now
You either didnt save and restarted the bot, or you are creating multiple instances of the bot in different occasions, its up to you to fix it since u dont provide enough info for us to see the actual issue
bruh bruh bruh now the 2 prefixs works
brUUUH
try doing commands.when_mentioned_or('#')
how
… multiple instances, i was right.
discord.ext.commands.when_mentioned_or(*prefixes)```
A callable that implements when mentioned or other prefixes provided.
These are meant to be passed into the [`Bot.command_prefix`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.Bot.command_prefix "discord.ext.commands.Bot.command_prefix") attribute.
Example
```py
bot = commands.Bot(command_prefix=commands.when_mentioned_or('!'))
```...
thats not the issue tho


