#discord-bots
1 messages · Page 755 of 1
lsáfmagsk
how do i remove a field in an embed?
@client.group(invoke_without_command=True)
async def help(ctx):
embed = discord.Embed(title = "Help", description = "Use >help <command> for extended on a command.", color=0x34568B)
embed.add_field(name="Moderation",value = "Moderation Commands")
embed.add_field(name = "Fun", value = "Fun commands")
embed.add_field(name = "Chat", value = "Chat commands")
embed.add_field(name = "Fun", value = "Fun commands")
embed.add_field(name = "Chat", value = "Chat commands")
await ctx.send(embed = embed)```
Hi
where the space? where?
Guys
!d discord.Embed
class discord.Embed(*, colour=Embed.Empty, color=Embed.Empty, title=Embed.Empty, type='rich', url=Embed.Empty, description=Embed.Empty, timestamp=None)```
Represents a Discord embed.
len(x) Returns the total size of the embed. Useful for checking if it’s within the 6000 character limit.
bool(b) Returns whether the embed has any data set.
New in version 2.0.
Certain properties return an `EmbedProxy`, a type that acts similar to a regular [`dict`](https://docs.python.org/3/library/stdtypes.html#dict "(in Python v3.9)") except using dotted access, e.g. `embed.author.icon_url`. If the attribute is invalid or empty, then a special sentinel value is returned, [`Embed.Empty`](https://discordpy.readthedocs.io/en/master/api.html#discord.Embed.Empty "discord.Embed.Empty").
For ease of use, all parameters that expect a [`str`](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.9)") are implicitly casted to [`str`](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.9)") for you.
@cedar stream
!d discord.Embed.remove_field
remove_field(index)```
Removes a field at a specified index.
If the index is invalid or out of bounds then the error is silently swallowed.
Note
When deleting a field by index, the index of the other fields shift to fill the gap just like a regular list.
Lije this
Something is wrong with my COGs. Can someone check?
Wht r u doing
thx
Await ctx.send(embed)
await ctx.send(embed=embed)
Try lowercase admin
Heyy
Bro…
! Resources
Hi
?
Look how u indented it
!resources
The Resources page on our website contains a list of hand-selected learning resources that we regularly recommend to both beginners and experts.
there is no excess space anywhere
It works as long as only the top 3 is there.
Ok, I fixed it. Now can u talk me through the auto lock after 5min?
There is no excess space?
Read the docs on discord.exc.tasks
!d discord.ext.tasks.loop
discord.ext.tasks.loop(*, seconds=..., minutes=..., hours=..., time=..., count=None, reconnect=True, loop=...)```
A decorator that schedules a task in the background for you with optional reconnect logic. The decorator returns a [`Loop`](https://discordpy.readthedocs.io/en/master/ext/tasks/index.html#discord.ext.tasks.Loop "discord.ext.tasks.Loop").
no
How to make bots
It’ s indented wrong
Please help
Do yk python
Ya
Do yk oop
Ya
where?
Do yk asynchronous programming
The await …
No
Try to delete the spaces and reindent
How to?
Read
K
what should the index be?
bro wtf i restart vsc and this shit work.
Index of the field u want to remove

I read the doc. How do I use it ?
Vsc messed up the indentation
like that?
Same way it says in the docs
It says what they are. Not how to use them
thank u @cedar stream or @lone lichen 
What do the docs say
Np
It also shows examples
Am I looking at the wrong doc?
Why would docs exist if they didnt show how to use it
Removes a field at a specified index.
If the index is invalid or out of bounds then the error is silently swallowed.
!d discord.ext.tasks.loop
discord.ext.tasks.loop(*, seconds=..., minutes=..., hours=..., time=..., count=None, reconnect=True, loop=...)```
A decorator that schedules a task in the background for you with optional reconnect logic. The decorator returns a [`Loop`](https://discordpy.readthedocs.io/en/master/ext/tasks/index.html#discord.ext.tasks.Loop "discord.ext.tasks.Loop").
!d discord.ext.tasks.loop
discord.ext.tasks.loop(*, seconds=..., minutes=..., hours=..., time=..., count=None, reconnect=True, loop=...)```
A decorator that schedules a task in the background for you with optional reconnect logic. The decorator returns a [`Loop`](https://discordpy.readthedocs.io/en/master/ext/tasks/index.html#discord.ext.tasks.Loop "discord.ext.tasks.Loop").
I clicked that top thing
sorry for not giving you the answer in the correct time man i was held up by other work
so sorry
NP
Can I use asyncio??
yea i use that for timed mutes
Ok, Let me see what I can come up with
k
first i made a dictionary to make several values for unit variable
for example if i want to mute someone for 10 seconds i put "S" in dictionary and then typed the value
which is 1
for a minute i put 60 for a hour i pout 3600
like taht
then after that i did this line of code
idk how to describe so i will just copy paste it
I mean. I don't think I need a dictionary. I'm only gonna need a 5 min interval all the time
oh ok
I don't think
then you just have to put the value as 60 in that
300
yup
you have to put that and after that
you have to put await asyncio.sleep(the variable you put for the time)
and then after that you have to put the line of code you want to put after the wait time
so
i'll show u
Um
@commands.Cog.listener()
async def on_message(self, ctx, message):
Unlock = discord.PermissionsOverwrite(send_messages=True)
Lock = discord.PermissionsOverwrite(send_messages=False)
Role = ctx.guild.default_role
if message.channel.id == 814207750342705164 and message.content.startwith('RPG miniboss', 'rpg miniboss'):
await ctx.channel.set_permissions(Role, overwrite=Unlock)
await ctx.send(f":white_check_mark: Unlocked {ctx.channel.name}")
await asyncio.sleep(300.0)
await ctx.channel.set_permissions(Role, overwrite=Lock)
await ctx.send(f"white_check_mark: Locked Down {ctx.channel.name}")
That look good?
@brittle axle
i think you need to put a variable inside a brackets
time = 300.0
use it like this
You don't need too
what is it
btw i cant stay long for too much tmrw i have a math test so i need to study for that
i think we need to put guild in that
It will but you will need to edit some stuff
thats what i did for mute when it came to channel permissions
like?
let me remove them all
Remove ctx and see
@final iron is what im saying correct. I am a little new to this lib and i created my own bot
adding new features slowly
No clue
We will see I guess
k
😢
The TextChannel or Thread that the message was sent from. Could be a DMChannel or GroupChannel if it’s a private message.
You have to remove ctx, only message is the argument passed to the event and self of course because you are in a cog, You can get ctx by using bot.get_context and passing the message object to it and set ctx as a variable
This only have to work in one channel
Add a check
My brain..
A little if statement
bot.get_context how do I do this part?
i need to go now @heavy radish sorry bye
You don't have to get context
Then what do I do?
The TextChannel or Thread that the message was sent from. Could be a DMChannel or GroupChannel if it’s a private message.
So you can use that
How?
channel attritbute?
I'll give you this one
It would be message.channel
So you would do message.channel.set_permissions(...)
Well where you need the channel you would do that
Like where you're setting the channels permissions and sending the message
Having problems with discord part
Unlock = discord.PermissionsOverwrite(send_messages=True)
Lock = discord.PermissionsOverwrite(send_messages=False)
What's the error
It's PermissionOverwrite
That won't work.
No errors 
How do I count members in status?
I just need it to be case insensitive
Did you change your Role = guild.default_role?
Just use .lower() on the message content ^^
!d discord.ext.commands.Bot.get_all_members
for ... in get_all_members()```
Returns a generator with every [`Member`](https://discordpy.readthedocs.io/en/master/api.html#discord.Member "discord.Member") the client can see.
This is equivalent to:
```py
for guild in client.guilds:
for member in guild.members:
yield member
message.content.startwith.lower('RPG miniboss'):
.lower()
its there
On the string.
Very basics of Python, have you learned it correctly?
!e
msg = "RPg MinIbOss"
if msg.lower().startswith("rpg miniboss"):
print("Yes")
@slate swan :white_check_mark: Your eval job has completed with return code 0.
Yes
no working
Can you show me how to write it down?
property users: List[discord.user.User]```
Returns a list of all the users the bot can see.
len(set(bot.get_all_members()))
As simple as that.
ok
Then why do you blindly send it :)))
Because you sent it and it errored
Probably a typo
Thanks I realized it :)
Just wondering, any reason to use that apposed to my method?
That is not the error. The error is above or below.
Still not the entire error.
The main part of error is still missing
It could be a ratelimited ip ( use kill 1 in console)
Well, considering you're using Replit. There is 99% chance that you are rate limited from using Discord's API.
You just destroy the terminal
Oh oki
Just press CTRL+C to terminate the running script.
And to kill the terminal instance it's CTRL+F4
Ohk thank you :D
heyy
from discord_slash import SlashCommand is this not ok ??
i have this code ```python
class closebutton(nextcord.ui.View):
def init(self):
super().init()
self.view = None
@nextcord.ui.button(label="🔒", style=nextcord.ButtonStyle.gray)
async def closebtn(self, button: nextcord.ui.Button, interaction: nextcord.Interaction):
user = interaction.user
emb=nextcord.Embed(title="🔒 Close Ticket", description=f"Είσαι σίγουρος οτι θέλεις να διαγράψεις το Ticket σου?", color=color, timestamp=datetime.now())
emb.set_author(name=user.name, icon_url=user.avatar.url)
await interaction.response.send_message(embed=emb, ephemeral=True)
class ticket1(nextcord.ui.View):
def __init__(self):
super().__init__()
self.view = None
@nextcord.ui.button(label="💎", style=nextcord.ButtonStyle.gray)
async def ticketbut(self, button: nextcord.ui.Button, interaction: nextcord.Interaction):
guild = interaction.guild
user = interaction.user
name = 'ticket'
view1 = self.closebutton()
category = nextcord.utils.get(interaction.guild.categories, name=name)
channel = await guild.create_text_channel(f'🎫Ticket-{user.name}', category=category)
await channel.set_permissions(interaction.guild.default_role, send_messages=True, read_messages=False)
await channel.set_permissions(user, view_channel = True)
await channel.set_permissions(guild.default_role, connect = False, view_channel = False)
await channel.send(f"{user.mention}")
emb=nextcord.Embed(title="🎫 Ticket Category", description=f"Επέλεξε από το παρακάτω `menu` την κατηγορία που ταιριάζει το **__Ticket__** σου.", color=color, timestamp=datetime.now())
emb.set_author(name=user.name, icon_url=user.avatar.url)
emb2=nextcord.Embed(title="🎫 Ticket Channel Created!", description=f"Έλεγξε το {channel.mention} για να ανοίξεις το **__Ticket__** σου.", color=color, timestamp=datetime.now())
emb2.set_author(name=user.name, icon_url=user.avatar.url)
await channel.send(embed=emb, view=view1)
await interaction.response.send_message(embed=emb2, ephemeral=True)
But i get this error when i press the 💎 button
`AttributeError: 'ticket1' object has no attribute 'closebutton'`
pls someone tell about this 🥲
Is there an error when importing it
its telling module not found
prolly don’t have discord slash or whatever it is installed
i just installed it 🥲
@slate swan can you send just the part where ticket1 is
@stable berry maybe restart VSCode and see if the right interpreter is selected
@slim ibex
does the same works with replit
I wouldn’t use replit
This is a somewhat older library and not really good i would suggest using Disnake.
^
can i dm u
true
and everything is public
ok trying to do the same in vs code
@slim ibex
close button doesn’t exist in the instance
I have this code:
@bot.command()
async def userinfo(ctx, *, user: discord.Member = None):
if user is None:
user = ctx.author
date_format = "%a, %d %b %Y %I:%M %p"
userembed = discord.Embed(color=0xdfa3ff, description=user.mention)
userembed.set_author(name=str(user), icon_url=user.avatar_url)
userembed.set_thumbnail(url=user.avatar_url)
userembed.add_field(name="Joined", value=user.joined_at.strftime(date_format))
members = sorted(ctx.guild.members, key=lambda m: m.joined_at)
userembed.add_field(name="Join position", value=str(members.index(user)+1))
userembed.add_field(name="Registered", value=user.created_at.strftime(date_format))
if len(user.roles) > 1:
role_string = ' '.join([r.mention for r in user.roles][1:])
userembed.add_field(name="Roles [{}]".format(len(user.roles)-1), value=role_string, inline=False)
perm_string = ', '.join([str(p[0]).replace("_", " ").title() for p in user.guild_permissions if p[1]])
userembed.add_field(name="Guild permissions", value=perm_string, inline=False)
userembed.set_footer(text='ID: ' + str(user.id))
return await ctx.send(embed=userembed)```
**And the error is this:**
https://cdn.discordapp.com/attachments/924690098749054997/932637465007783966/Rocket_Beta.py_-_Replit_-_Opera_17_1_2022_4_07_11_2.png
Import "discord.ext" could not be resolvedPylancereportMissingImports
What is members.index?
Seems like there's no user in members
what is this ?
hello
In his case it is a list sorted by joining date
!d discord.ext.commands.Bot
what d you mean?
the button1 instance does not contain the close button method
@slate swan you may try get the list of ids out of list of members and then use index with id
why its saying error when i am running in vs code
CTRL+SHIFT+P and type in interpreter and choose the latest Python interpreter
why do I get an indent error? It looks good to me..
it's at await message.channel.send(encouragements)
I suggest using tabs instead of spaces.
okay, I'll try it out
it says i'm already using tabs
Sure you aren't mixing them?
It is indented Too far I believe
how? 😁
The indention lines are pretty small i'm guessing he/she want to do that other if first.
It should be in the line under the if
Setting indention level to 4 might see these easier.
holy fuck
@commands.command()
@commands.is_owner()
@commands.bot_has_permissions(send_messages=True)
async def dev_invite(self, ctx, guild_id : int):
try:
guild = self.bot.get_guild(guild_id)
except:
return await ctx.reply('Invaild guild id.')
try:
invite = await guild.text_channels[0].create_invite()
except:
return await ctx.reply('I do not have permissions to create invites in that guild.')
await ctx.check()
return await ctx.author.send(invite)
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: AttributeError: 'Context' object has no attribute 'check'
Yeah website coding is kinda ..
^
!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.
@commands.command()
@commands.is_owner()
@commands.bot_has_permissions(send_messages=True)
async def dev_invite(self, ctx, guild_id : int):
try:
guild = self.bot.get_guild(guild_id)
except:
return await ctx.reply('Invaild guild id.')
try:
invite = await guild.text_channels[0].create_invite()
except:
return await ctx.reply('I do not have permissions to create invites in that guild.')
await ctx.check()
return await ctx.author.send(invite)```
Command raised an exception: AttributeError: 'Context' object has no attribute 'check'
how should i fix it?
This seems kind of inappropriate.
Well you got private guilds and i respect privacy.
i own
my bot is a private
and i have rulesets for every server that uses my bot
and they own a license to my bot
i have permission to grab that guild i feel like it my g
there
Much better
No you don't.
Top if with new isn't indented properly.
its in my ruleset
im confused now 🥲
ok
u actually mad slow
Okay but that doesn't automatically make it appropriate and also keep it civil in here.
i can do wtv i want
then stop complaining and help u panda ass kid
!rule 5
5. Do not provide or request help on projects that may break laws, breach terms of services, or are malicious or inappropriate.
it doesnt breach tos
replit error
i have this code ```python
class closebutton(nextcord.ui.View):
def init(self):
super().init()
self.view = None
@nextcord.ui.button(label="🔒", style=nextcord.ButtonStyle.gray)
async def closebtn(self, button: nextcord.ui.Button, interaction: nextcord.Interaction):
user = interaction.user
emb=nextcord.Embed(title="🔒 Close Ticket", description=f"Είσαι σίγουρος οτι θέλεις να διαγράψεις το Ticket σου?", color=color, timestamp=datetime.now())
emb.set_author(name=user.name, icon_url=user.avatar.url)
await interaction.response.send_message(embed=emb, ephemeral=True)
class ticket1(nextcord.ui.View):
def __init__(self):
super().__init__()
self.view = None
@nextcord.ui.button(label="💎", style=nextcord.ButtonStyle.gray)
async def ticketbut(self, button: nextcord.ui.Button, interaction: nextcord.Interaction):
guild = interaction.guild
user = interaction.user
name = 'ticket'
view1 = self.closebutton()
category = nextcord.utils.get(interaction.guild.categories, name=name)
channel = await guild.create_text_channel(f'🎫Ticket-{user.name}', category=category)
await channel.set_permissions(interaction.guild.default_role, send_messages=True, read_messages=False)
await channel.set_permissions(user, view_channel = True)
await channel.set_permissions(guild.default_role, connect = False, view_channel = False)
await channel.send(f"{user.mention}")
emb=nextcord.Embed(title="🎫 Ticket Category", description=f"Επέλεξε από το παρακάτω `menu` την κατηγορία που ταιριάζει το **__Ticket__** σου.", color=color, timestamp=datetime.now())
emb.set_author(name=user.name, icon_url=user.avatar.url)
emb2=nextcord.Embed(title="🎫 Ticket Channel Created!", description=f"Έλεγξε το {channel.mention} για να ανοίξεις το **__Ticket__** σου.", color=color, timestamp=datetime.now())
emb2.set_author(name=user.name, icon_url=user.avatar.url)
await channel.send(embed=emb, view=view1)
await interaction.response.send_message(embed=emb2, ephemeral=True)
But i get this error when i press the 💎 button
`AttributeError: 'ticket1' object has no attribute 'closebutton'`
Privacy
It does
@slate swanexcuse me?
i bet rule1 is be nice and friendly
You cannot just create random invites with the bot
doesnt seem like that
can anyone tell me why its showing Import "discord.ext" could not be resolvedPylancereportMissingImports
!rule 1
1. Follow the Python Discord Code of Conduct.
how do I fix it? If I can of course
u make no sense
CoC has that yeah.
ur downing me for "illegal code"
it should not matter
its not even illegal code
pls help
it would work still
even dyno has dev_invite
Do u have something like py from discord.ext import Smthing
ur mad slow
its replit being dum
No i'm choosing not to help you since it is inappropriate.
well, It doesn't work
yes
!mute 926504003167203348 4h your recent message history is really unacceptable. abide by our #code-of-conduct and #rules
:incoming_envelope: :ok_hand: applied mute to @slate swan until <t:1642443970:f> (3 hours and 59 minutes).
hmmm
@slate swan don't DM me, please DM @novel apex
if i've missed something, we can address it via modmail
is discord.py/your fork installed? And you are in that python environment?
yes
show the full import line
yes
import typing
import discord
from discord_slash import SlashCommand
from discord.ext import commands
hey guys is discord.py still alive? i haven't been here in soooo long
i thought danny stopped mainataining the lib?
Disnake fork is doing wonders :3
there are dots also
I'll suppose you discord.py installation is wrong
As for the slash commands why don't you use a fork instead
works with slash?
😕
Yeah it's great.
Yea , there are forks and other libraries tho
https://PyPi.org/project/Disnake
https://PyPi.org/project/nextcord
https://PyPi.org/project/hikari
Preferable Libraries
Disnake and nextcord are forks , hikari is a completely different library
other libs? NAAAAH. Other Forks? i'm listening
try reinstalling discord.py , and reopen your editor
I'm sorry, many of us here aren't too familiar with Discord.py extensions since there are around 5 library extensions for it. Most people use forks, discord.gg/dpy this could maby help you.
Well then go for Disnake
It's worth it
I prefer disnake
Disnake is king :3
ok
indeed
100%
ok
Actually been suggesting Disnake ever since Danny announced the stop. Glad i did.

why did my message get deleted
Hey does anyone know why python nested if statements don't work when developing discord bots? Here is an example line of code
if message.content.startswith('$example'):
if gamestarted == True:
await message.channel.send('Variable equals true')
if gamestarted == False:
await message.channel.send('Variable equals true')
Maby invite url? You could ask @novel apex
I've been using hikari before the shutdown for experimental purpose and now I feel like it was worth learning
kk
This is the error message I get
@slate swan we filter .gg
Why don't you use Commands framework?
kk
Well the error says your problem itself
This is the error message
This is the error message
Just send a different string here and then put the .gg/xxx in your code
ye
Oh , relatable
Well your error means that the variable is not defined yet
@slate swan as I said, you need to remove it from your message here
3th time is the charm
ok
Anyone have a button code in Python ?, everything I tried did not work ..
i want to make so when you put the invite link to the server in ur status not bio ur status the bot gives you a role
What do you got so far?
so basically i have an on_command_error event in my main file which runs the bot and the cogs and stuff, but here's the twist.
for some fucking reason it sends it twice
!d disnake.on_member_update
disnake.on_member_update(before, after)```
Called when a [`Member`](https://docs.disnake.dev/en/latest/api.html#disnake.Member "disnake.Member") updates their profile.
This is called when one or more of the following things change:
• nickname
• roles
• pending...
Lol because original error reporting is also on.
so how do i make it send the error once
kk imma try that
Are you using Disnake?
yea but i did something wrong i accidentally had an on_command_error event in one of my cogs
ill get back here if my thing still happens
Ah okay.
i want it to check if user has the invite link in status if the user has it the bot will give a role
i thought the on_command_error event in cogs would only trigger when a command in the cog gets an error
i went through the disnake docs, thankfully it's almost as same as dpy
button = Button(label="click", style=discord.ButtonStyle.green,emoji="😀")
view = view()
view.add_item(button)
await ctx.send("hello", view=view)```
btw did dpy v2 ever officially realease?
uh-
what is view() class
No
i kinda didnt code discord bots in a while
heartbreaking
ikr but the switch to disnake didn't affect anything, all was just search replacing
Preferably disnake
yeah disnake is cool
yeah i know
can someone help me i want the bot to check if user has the invite link in status if the user has it the bot will give a role
!d discord.Member.activities
The activities that the user is currently doing.
Note
Due to a Discord API limitation, a user’s Spotify activity may not appear if they are listening to a song with a title longer than 128 characters. See GH-1738 for more information.
💀
!d discord.CustomActivity
class discord.CustomActivity(name, *, emoji=None, **extra)```
Represents a Custom activity from Discord.
x == y Checks if two activities are equal.
x != y Checks if two activities are not equal.
hash(x) Returns the activity’s hash.
str(x) Returns the custom status text.
New in version 1.3.
i searched there
but as an official release
i couldn’t find
just iterate through member.activities and use isinstance to see if the activity type is discord.CustomActivity
no no no
discord.CustomActivity is the custom status that users put
ik
The custom activity’s name.
And just do if link in status.name
no bruh
i want it like
invite_link = “the discord vanity here”
like if user has invite_link in status it gives them a role
Ik lol
i’m stupid ☠️
okay so what you want is that the user should have a link in the status and the bot gifts them a rolea/
If I was making a /ban command how would I make it have another field
yh
for the members name
for activity in member.activities:
if isinstance(activity, discord.CustomActivity):
status = activity.name
# STATUS IS NOW THE TEXT IN THE USER STATUS
☠️ i’m so stupid
i had an easier way of doing this but i stopped coding for a while and somehow forgot some things
@cloud dawn for that code/user earlier, creating guild invites. can you explain or point me to why that's Discord ToS breaking?
Creating random invites from bot.guilds and joining those servers?
@maiden fable is that really you?
Uhhh, yea ig? It's me only???
Helloo, so i think this is more of a replit problem than actual bug int he code. so i put my discord bot code into replit and then ran it, and instead of running it gave me this error: ```
Because no versions of discord match >1.7.3,<2.0.0
and discord (1.7.3) depends on discord.py (>=1.7.3), discord (>=1.7.3,<2.0.0) requires discord.py (>=1.7.3).
Because discord.py (1.7.3) depends on aiohttp (>=3.6.0,<3.8.0)
and no versions of discord.py match >1.7.3, discord.py (>=1.7.3) requires aiohttp (>=3.6.0,<3.8.0).
Thus, discord (>=1.7.3,<2.0.0) requires aiohttp (>=3.6.0,<3.8.0).
So, because repl-python3-challengebot depends on both aiohttp (^3.8.1) and discord (^1.7.3), version solving failed.
at /opt/virtualenvs/python3/lib/python3.8/site-packages/poetry/puzzle/solver.py:241 in _solve
237│ packages = result.packages
238│ except OverrideNeeded as e:
239│ return self.solve_in_compatibility_mode(e.overrides, use_latest=use_latest)
240│ except SolveFailure as e:
→ 241│ raise SolverProblemError(e)
242│
243│ results = dict(
244│ depth_first_search(
245│ PackageNode(self._package, packages), aggregate_package_nodes
exit status 1
Replit: Package operation failed.``` so basically aiohttp and that python version aren't really cooperating? Can someone pls tell me how to fix this? I'm very new to repl, so this may seem easy to some of you. pls ping when you respond
bro long timeeee
I forgot u ngl, sorry
@maiden fable can i invite u to the project and u help me?
😭
Sorry bruv, on mobile rn
brah
bro, all you gotta do is copy paste the code he sent
yea
and put in your variables obviously
i’m stupid brah
wait lemme see
so is activity a variable?
It's just replit being replit , do you have discord.py in requirements.txt?
do you know how to code in python?
no
It's basic Python bro... Making a for loop
Sort of, it is
☠️
!d for @slate swan
well it could be changed as long as the lor loop thing is chnged along with it
changed*
Yea
oh it’s status = . gg / void
No
bro why am i so stupid today
Brooo why
there isn't any requirements.txt. im using somone's tutorial to host my discord bot. they made a video and there wasn't any need for a requirements.txt
idk
the difference is that they didnt have aiohttp
Replit's poetry is bad , try creating a new repl
Sorry, @maiden fable, caught by the spam filter because your message contained an invite link.
wtf
lmao
?
W in TF
Ah yea, I remembered it after sending the message, sorry
Erm, @slate swan, not appropriate.
what you never seen tits before?
HOW??
Let's not post memes here please.
sorry
The image you posted and deleted.

Bruh
bruh this is a python server
LMAO
that was last meme i promise
Bots don't have them , so we don't talk about them here
Let's get back to topic
I hope so. I will be handing out mutes if there are more memes here. Be warned!
dude
bruh
Pls stop
Alright
stppit
stop what
!mute 929023092842459136 Take a time out.
:incoming_envelope: :ok_hand: applied mute to @slate swan until <t:1642435386:f> (59 minutes and 59 seconds).
ty LX 
😄 ty!
Out of interest, why is it bad?
Back to the topic of this channel please.
how to stop a running bot in vs code
ctrl + c
ok tq
np
unindent does not match any outer indentation level
didnt worked 😦
in the terminal click the end thing and press ctrl + c
conflicts with the python libraries versions, even for supported versions
Just like the person faced above , also creating another repl fixes it ( which doesn't makes sense)
^^¢
Fair enough
ty! ill test it out
often such error aren't actually where it says it is so, you should go through the code maybe you put and extra space somewhere?
ok
it'll stop running the file and then the bot will stop working until you run it again
okay
ok
and your indentations should be constant, 2spaces, 4 spaces, whatever, it should be the same throughout
You have 2 spaces indent in one block and 4 spaces in another, it must be the same everywhere. Python standard is 4 iirc. Also don't do commands like this
tq so much it worked actually i didnt run any cmd but when i run a cmd the bot stopped
😄
tq
sure
okay
ok
Slash commands & message intents
Discord is lately leaning much more towards slash commands (application commands).
They are meant to provide users a first-class way of interacting directly with
your application that feels deeply integrated into Discord.
As of April 30, 2022 if your bot is verified you would need to request message intents.
This changes only verified bots, If are verified and want this you would need
to request this (See resources).
Registering slash commands
To register global slash commands simply don't define a guilds or test_guilds in your bot.
Global commands will fan out slowly across all guilds, and will be guaranteed to be updated in an hour.
There is a global rate limit of 200 application command creates per day, per guild
Slash command types and limits
Slash has 3 unique command types:
CHAT_INPUT: Slash commands; a text-based command that shows up when a user types / (limit 100*)
USER: A UI-based command that shows up when you right click or tap on a user (limit 5)
MESSAGE: A UI-based command that shows up when you right click or tap on a message (limit 5)
Max 25 choices or autocomplete suggestions.
- Be aware that sub-commands is a command
Sub-commands
Subcommands organize your commands by specifying actions within a command or group.
Using subcommands or subcommand groups will make your base command unusable.
Common issues
This is a common error, this means in the scope applications.commands isn't enabled.
[WARNING] Failed to overwrite commands in <Guild id=923632089834864690> due to 403 Forbidden (error code: 50001): Missing Access
To solve this go to https://discord.com/developers/applications and let the bot rejoin (See screenshot).
Command names are always lower case in slash.
Resources used
Discord developer docs: https://discord.com/developers/docs/interactions/application-commands
Message content: https://support-dev.discord.com/hc/en-us/articles/4404772028055
Screenshots:
Hey my bot's prefix is when_mentioned_or() but when i send @ everyone , it is triggering.... How can i fix?
return when_mentioned_or(prefix)
what do you mean by not doing commands like this?
@inter_client.slash_command(description="see ur bank", options=[
Option(
name="user",
description="see ur friends bank",
option_type=6,
required=False)])
async def bank(interaction, user:discord.Member=None):
``` why is this not working
Remember to:
• Show a code sample as text (rather than a screenshot) and the error message, if you got one.
• Explain what you expect to happen and what actually happens.
why is this not working is not descriptive enough
ok
well lets start with I want you to be able to see other peoples banks
but it is not required
error message:
Traceback (most recent call last):
File "c:\Users\\OneDrive\Documents\casino bot\main.py", line 96, in <module>
Option(
File "C:\Users\\AppData\Local\Programs\Python\Python39\lib\optparse.py", line 569, in __init__
opts = self._check_opt_strings(opts)
File "C:\Users\\AppData\Local\Programs\Python\Python39\lib\optparse.py", line 589, in _check_opt_strings
raise TypeError("at least one option string must be supplied")
TypeError: at least one option string must be supplied
Do not put them into on_message event, there's a decorator for creating commands
@bot.command()
async def somenicecommand(ctx):
#command content```
idk how this is happening but by removing the when mentioned you can do this
@client.event
async def on_message(message):
if client.user.mention in message.content:
await message.channel.send("You can type `!vx help` for more info.")
@rugged tangle check this out for more https://tutorial.vcokltfre.dev/tutorial/03-hello/
In this part, I’ll show you the basics of how to create a super simple bot and get it connected to Discord.
Wait a sec
Ah thx, seen good
you can use a on_message event it's much better
you can setup a custom prefix function where you pass in the bot and message like this
def prefix(bot, message):
prefix = ?
return when_mentioned_or(prefix)(bot, message)
If you have a database
Better for what
you can replace the ? with a query to find the prefix in the database for the specific server
better for a beginner who can't sometimes understand
Implementing commands in on_message is bad practice and shouldn't ever be used. By telling people to use this you are basically providing misinformation
@cloud dawn if I may ask, why do you limit the amount of packages passed in to your pypi package autocomplete to 25?
No its not
that's optional brother i never forced any1 to use it, i thought it's better that's why i suggested it, if you are having problems i am sorry, my bad
By using an on_message event you are limiting yourself from using tons of resources
^
and i am not talking about commands i am talking about sending a message upon client mention
It is better to learn the right way at first rather than to re-learn
You cannot implement it without special function in a normal way
why can't i? bro i've done it myself without any "special function"
In on_message?
Yes
why my slash command giving this reply any idea (bcs the normal code is giving the correct output)
Well you can use it but you shouldn't. When it comes to arguments, on_message is very complicated unlike commands
The application did not respond
you win i lose let's not argue
Yeah
I am not arguing btw I am just trying to show the right way, sorry if I offended you somehow
yes, you are right and i think it's right to not use on_message events for these types of things
👍
actually i've been off from coding for a while that's why i suggested it
im also sorry if you were offended in some way
see all he's saying that it's bad because it uses up resources which on a wider scale could be detrimental to your bot because then it'll have to go through each and every text send in the entire server and then have to execute whatever code you have in the on-message which could be heavy for your server, at a smaller level i dont think on message has any harm
on_message sorry*
so like, avoid on_message for production at least
Even on a small scale you're missing out on things
You don't have access to decorators
yeah prolly
@stable berry if the code takes long to evaluate you should defer the response not to cause this, in different libraries it might be done in different ways, for example in disnake it is
await inter.response.defer()```
@final iron I sent the error message ^
yeahhh
Am I doing something wrong here?
@slash_command(name="pypi", description="Sends the pypi of a valid package")
async def pypi(self, inter: disnake.ApplicationCommandInteraction,
package: str = commands.Param(autocomplete=pypi_autocomplete)):
I'm getting a TypeError: pypi_autocomplete() missing 1 required positional argument: 'user_input'
Since 25 is the limit discord will show in a list. So it isn't a long list.
I'll add that to mine then
If I can actually get it working
I'm looking at the docs and they do something extremely similar
Action actually crashes if you provide more than 25
what do you suggest i do?
Could you show pypi_autocomplete func?
Can any help me and my friend are facing
I and my friend thought to host a discord bot which was disconnected few months ago
So we asked the devs for the code and we got it but we ran into an huge error of db mongo uri , it needs 4 uri's but we do not know it how to solve as we are new to mongo things
please help us brothers
How would i make my discord bot send to any channel?
By getting the channel object first.
#databases seems more suited for this.
How can I fix the loop. I need it there
@bot.event
async def on_message(ctx):
if ctx.author.bot:
return
for word in naughty_words:
if word in ctx.content:
if ctx.author.guild_permissions.manage_messages:
...
else:
await asyncio.sleep(3)
await ctx.delete()
await ctx.channel.send(f"{ctx.author.mention}, you aren't allowed to say that!")
await bot.process_commands(ctx)
shouldn't it be ctx.context?
for word in naughty_words:
if word in ctx.context:
Thanks. I'll try
OH YEA WAIT MY BRAIN IS LEGIT DYING XD
No it should be ctx.message.content
same rn
async def pypi_autocomplete(self, inter: disnake.ApplicationCommandInteraction, user_input: str) -> List[str]:
cursor = await self.bot.connection.cursor()
packages = await cursor.execute(f"SELECT package FROM pypi_packages").fetchone()
return sorted([lang for lang in list(packages) if user_input.lower() in lang.lower()])[:25]
You don't need the user_input you only need to return a list.
Discord does the rest for you
nope. My bot is spamming me with "@hard trail, you aren't allowed to say that!" every 5 seconds
Alr
Wait
But what about line 4
user_input.lower()
Well that isn't valid code.
I don't understand this
You only need to return a list of strings (suggestions)
Discord will automatically insert the list into autocompletion, you don't have to manually check the content.
So I just have to return the list of packages?
@cloud dawn I got this error message
I know since the if is wrong but i got to go rn, i was already helping water_gazes so i'll finish with him. Sorry.
Yep that suffices.
Nice
alright when you can please help
Well i'm going to eat with my grandma so i will be back in around a hour and a half :3
K
Okay i also came here yesterday because I had the same problem.
My code:
@bot.command()
async def pro(ctx, member: discord.Member = None):
prousers = [485442448244342786, 608575327811272704]
if member.id in prousers:
await member.send("You have activated your pro membership!")
prorole = get(ctx.guild.roles, id=911248795382194201)
await member.add_roles(prorole)
else:
await member.send("You have no pro packages to activate!\nYou can buy pro packages at our website, or win them by a giveaway.")
I want to send a different dm message for certain users.
Although I get errors
dont use utils.get for getting role , use ctx.guild.get_role(id) , and whats the error you face?
i tried that but a guy changed it
Maybe you want to add a user to pro users?
here
Unrelated, but @slate swan if u like web dev, look into svelte!
yea and also send a message in dm either if they can activate their pro package or they dont have
Or you are checking if the user is eligible for pro
no
Nvm forget it
owh , what does it do>
DMs
@kind wind member doesn't seem like an optional argument, why are you making it such
check this
i got the updated code from him bc he said it was correct
so what?
return sorted([package for package in [package_tuple[0] for package_tuple in packages]][:25])
Readability 
Reduced my code by 4 whole lines though
Can you restate your issue?
And send the new code?
Its hard following an old thread
@Client.slash_command(guild_ids=[testingServerID])
AttributeError: 'Bot' object has no attribute 'slash_command'
Can someone help?
I changed the code for the role but just for that
@bot.command()
async def pro(ctx, member: discord.Member = None):
prousers = [485442448244342786, 608575327811272704]
if member.id in prousers:
await member.send("You have activated your pro membership!")
prorole = ctx.guild.get_role(911248795382194201)
await member.add_roles(prorole)
else:
await member.send("You have no pro packages to activate!\nYou can buy pro packages at our website, or win them by a giveaway.")
Also what i want: I want to use the command and send a dm message and say either for the users that have un-activated pro membership that it is activated and give them the role and if they aren't in that list say that they don't have any pro packages. I want this to go on DM-only
Can I see your entire file?
!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.
So whats your issue?
IT GIVES ME ERROR
Bro calm down
I have already said that
Then lets see the error
When are u gonna share the error
Ignoring exception in command pro:
Traceback (most recent call last):
File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\ext\commands\core.py", line 85, in wrapped
ret = await coro(*args, **kwargs)
File "c:\Users\user\Desktop\Vaggelis\Coding\Bots\VDP's Utilities\main.py", line 106, in pro
if member.id in prousers:
AttributeError: 'NoneType' object has no attribute 'id'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\ext\commands\bot.py", line 939, in invoke
await ctx.command.invoke(ctx)
File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\ext\commands\core.py", line 863, in invoke
await injected(*ctx.args, **ctx.kwargs)
File "C:\Users\user\AppData\Local\Programs\Python\Python310\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: AttributeError: 'NoneType' object has no attribute 'id'
member is None
You never passed in member when you were running the command therefore it defaulted to None
So something like
!pro @final iron
» kindling-projects
» xy-problem
» kindling-projects
» xy-problem
@bot.command
async def pro(ctx, user : discord.Member = None):
The None must change to what?
how
Remove the None
You should just supply a member argument, or you can add an if statement to handle if they don't give a member argument, + what gazes said
im justing sending the code
This is also an option user = user or ctx.author
Does the same thing as the if statement but its on 1 line
yeah not this
Then don't have a member argument
from
async def pro(ctx, user : discord.Member):
```It will be
async def pro(ctx):
Yes
none makes it a optional argument
and pep8 smh
what about these
ctx.author is a member object
what are you trying to do
if youre trying to add roles to author use ctx.author.id
You would change member.id to ctx.author.id
let me try
Since ctx.author a member object
yup
Works!

nice
Good job
best discord hosts?
check pins
ty sir
it says that
seems like u broke replit lol
Hey @twin moon!
It looks like you tried to attach a Python file - please use a code-pasting service such as https://paste.pythondiscord.com
'Comment_View' object has no attribute 'children'
how XD
u didn't call super().__init__() @twin moon
so fast
I didn't open the link tho
make another repl
Hey hello I was making thsi bot.. I wanted this command to be used by admins only.. so I have added @urban notch_permissions .. I wanted to know do I need to do some error handling?
I just know solutions to most of the simple issues
if someone doesn't has the perms, then yes
okk
!d discord.ext.commands.MissingPermissions
exception discord.ext.commands.MissingPermissions(missing_permissions, *args)```
Exception raised when the command invoker lacks permissions to run a command.
This inherits from [`CheckFailure`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.CheckFailure "discord.ext.commands.CheckFailure")
@drifting vigil
I guess u mean only when someone without permission tries to use the bot..?
how do I do that?
on_command_error
what should be in that function?
ok thanks
I'm getting this error
Traceback (most recent call last):
File "/data/user/0/ru.iiec.pydroid3/files/accomp_files/iiec_run/iiec_run.py", line 31, in <module>
start(fakepyfile,mainpyfile)
File "/data/user/0/ru.iiec.pydroid3/files/accomp_files/iiec_run/iiec_run.py", line 30, in start
exec(open(mainpyfile).read(), __main__.__dict__)
File "<string>", line 2
from discord-buttons import DiscordButton
^
SyntaxError: invalid syntax
[Program finished]
Ok
Traceback (most recent call last):
File "/data/user/0/ru.iiec.pydroid3/files/accomp_files/iiec_run/iiec_run.py", line 31, in <module>
start(fakepyfile,mainpyfile)
File "/data/user/0/ru.iiec.pydroid3/files/accomp_files/iiec_run/iiec_run.py", line 30, in start
exec(open(mainpyfile).read(), __main__.__dict__)
File "<string>", line 2, in <module>
ModuleNotFoundError: No module named 'discord_buttons'
[Program finished]```
Even though it is installed
use dpy 2.0 or a fork instead
or if you still wanna use this check the docs for discord-buttons
and see how to import and install it there
act = input('What activity do you want your bot to do? ')
bot = commands.Bot(command_prefix=prefix, activity=discord.Activity(type=discord.ActivityType.act
act is a string
u can instead do discord.ActivityType["act"]
!e
from enum import Enum
class A(Enum):
name = 1
print(A["name"].value)
@maiden fable :white_check_mark: Your eval job has completed with return code 0.
1
discord.ActivityType[act].value
does anybody know how to make a command so that bot joins a VC, reads a MP3 file and leaves (I dont know if there is any difference but Im in replit)?
!d discord.VoiceChannel.connect
await connect(*, timeout=60.0, reconnect=True, cls=<class 'discord.voice_client.VoiceClient'>)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).
Connects to voice and creates a [`VoiceClient`](https://discordpy.readthedocs.io/en/master/api.html#discord.VoiceClient "discord.VoiceClient") to establish your connection to the voice server.
This requires [`Intents.voice_states`](https://discordpy.readthedocs.io/en/master/api.html#discord.Intents.voice_states "discord.Intents.voice_states").
!d discord.VoiceClient.play
play(source, *, after=None)```
Plays an [`AudioSource`](https://discordpy.readthedocs.io/en/master/api.html#discord.AudioSource "discord.AudioSource").
The finalizer, `after` is called after the source has been exhausted or an error occurred.
If an error happens while the audio player is running, the exception is caught and the audio player is then stopped. If no after callback is passed, any caught exception will be displayed as if it were raised.
thanks
creating a discord bot bump checker where it checks if a bump is availble for my server and dms me to bump it. How do I check for it?
scrape the website
!pypi beautifulsoup4
if yk how to use b64 and implement it in discord could u help me?
@maiden fable
@client.event async def on_command_error(ctx, error): print(ctx.command.name+" invoked by unauthorized user") print(error)
did this what else do I need?
I don't sorry
no
it triggers if there is any error, even a KeyError or ValueError or smth
!d isinstance
isinstance(object, classinfo)```
Return `True` if the *object* argument is an instance of the *classinfo* argument, or of a (direct, indirect, or [virtual](https://docs.python.org/3/glossary.html#term-abstract-base-class)) subclass thereof. If *object* is not an object of the given type, the function always returns `False`. If *classinfo* is a tuple of type objects (or recursively, other such tuples) or a [Union Type](https://docs.python.org/3/library/stdtypes.html#types-union) of multiple types, return `True` if *object* is an instance of any of the types. If *classinfo* is not a type or tuple of types and such tuples, a [`TypeError`](https://docs.python.org/3/library/exceptions.html#TypeError "TypeError") exception is raised.
Changed in version 3.10: *classinfo* can be a [Union Type](https://docs.python.org/3/library/stdtypes.html#types-union).
if isinstance(error, commands.MissingPermissions):
await ctx.send("Unauthorized user")
else:
raise error
BTW the else statement is compulsory
this should be in the same function right?
Ye
File "main.py", line 504, in <module>
bot.run(os.getenv("TOKEN"))
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/client.py", line 678, in run
return future.result()
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/client.py", line 658, in runner
await self.start(*args, **kwargs)
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/client.py", line 621, in start
await self.login(*args, bot=bot)
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/client.py", line 472, in login
await self.http.static_login(token.strip(), bot=bot)
AttributeError: 'NoneType' object has no attribute 'strip'```
why doesn't it work?
i have a command where a user can give themself a role
i want my bot to renickname that user the last three letters of the name of that role
how would i go about this?
can I use colors in messages my discord bot sends?
!d discord.permissions.change_nickname
No documentation found for the requested symbol.
yes
your token isnt correct
can you give an example how?
!d discord.Member.edit
await edit(*, nick=..., mute=..., deafen=..., suppress=..., roles=..., voice_channel=..., reason=None)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).
Edits the member’s data.
Depending on the parameter passed, this requires different permissions listed below...
everything should be fine with the token, as long as I specified it to be correct
its a class lmao
hello... pls suggest alternativez to discord.py... stable....
wait let me screenshot it
!pypi disnake
was I pinged twice?
yes
this is a good way for color text
so... most people in this channel using this?
thats correct
what about hikari?
🧍♂️
its not fully developed or what?
you can if you dont want a fork of dpy
oh, thank you
woah dude... easy easy
lol
I couldn't find the docs. Could you see if you can find them I may just be using the wrong search term
I use nextcord and pincer
no
Ok
!pypi discord-buttons
!pypi nextcord
A Python wrapper for the Discord API forked from discord.py
!pypi pincer
just use any fork lol
could you give an example of code for messages with colored text?
wdym
I'm having trouble understanding how I should add it from just what you've linked me
for my discord bot, the bit of code that would send a message with colored text
you can use that or codeblocks
!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.
not the py code block
other lans
i have this code ```python
class closebutton(nextcord.ui.View):
def init(self):
super().init()
self.view = None
@nextcord.ui.button(label="🔒", style=nextcord.ButtonStyle.gray)
async def closebtn(self, button: nextcord.ui.Button, interaction: nextcord.Interaction):
user = interaction.user
emb=nextcord.Embed(title="🔒 Close Ticket", description=f"Είσαι σίγουρος οτι θέλεις να διαγράψεις το Ticket σου?", color=color, timestamp=datetime.now())
emb.set_author(name=user.name, icon_url=user.avatar.url)
await interaction.response.send_message(embed=emb, ephemeral=True)
class ticket1(nextcord.ui.View):
def __init__(self):
super().__init__()
self.view = None
@nextcord.ui.button(label="💎", style=nextcord.ButtonStyle.gray)
async def ticketbut(self, button: nextcord.ui.Button, interaction: nextcord.Interaction):
guild = interaction.guild
user = interaction.user
name = 'ticket'
view1 = self.closebutton()
category = nextcord.utils.get(interaction.guild.categories, name=name)
channel = await guild.create_text_channel(f'🎫Ticket-{user.name}', category=category)
await channel.set_permissions(interaction.guild.default_role, send_messages=True, read_messages=False)
await channel.set_permissions(user, view_channel = True)
await channel.set_permissions(guild.default_role, connect = False, view_channel = False)
await channel.send(f"{user.mention}")
emb=nextcord.Embed(title="🎫 Ticket Category", description=f"Επέλεξε από το παρακάτω `menu` την κατηγορία που ταιριάζει το **__Ticket__** σου.", color=color, timestamp=datetime.now())
emb.set_author(name=user.name, icon_url=user.avatar.url)
emb2=nextcord.Embed(title="🎫 Ticket Channel Created!", description=f"Έλεγξε το {channel.mention} για να ανοίξεις το **__Ticket__** σου.", color=color, timestamp=datetime.now())
emb2.set_author(name=user.name, icon_url=user.avatar.url)
await channel.send(embed=emb, view=view1)
await interaction.response.send_message(embed=emb2, ephemeral=True)
But i get this error when i press the 💎 button
`AttributeError: 'ticket1' object has no attribute 'closebutton'`
for what language
allot of lans make text colored
closebutton function doesn’t exist in the ticket1 instance
@weary mirage
oh that
mhm
forgot you could do that
just codeblocks
can I have it be multiple colors in just one message?
no
their code blocks
hi
something
see
first one is in ruby and the other one is in py
and they get separated
could you give an example of the colored text code bock already written
... and this will work for what a discord bot is sending? O.o
yes a discord bot can send code blocks
so what should i change?
could you give... an example... of what the code would look like on python for that bit please
What is the close button supposed to do
just do
await ctx.send("``diff\n +i m green\n - im red``")
how i get server icon and avatar url in disnake
okay, thank you
with 3 back ticks
add a button that if you click it, it deleted the channel( i havent made that yet i am just trying to add the button to the message)
yw
technically yes
So the diamond button will delete the channel
that is a code block
yes but with languages like diff
I put this
nope the 🔒 one. The diamond one creates a channel and sends an embed to this channel. In this embed i also want to add this lock button that deletes the channel that the diamond button created. I know its complicated
and I got this
they should be a space in the plus
When will slash command support be added if it isn't already?
should or shouldn't o.o
It has to because isn't discord going to have bots without slash commands not work
ok so let me get it straight. You are making a ticket system and when you press the diamond emoji:
- it make a new channel
- sends an embed to that channel
- the embed has a lock button where the ticket can be closed and the channel is deleted
Can this lock button be pressed and interaction be completed by the moderator and user?
yeah but its for verified bots iirc
I don't know what other i there is, I put a space and I got the same result, Okimii
So basically any discord.py bot that is verified won't work
oh wait, I think I got you
yes exactly. Dont worry. I have the code for closing the channel. I just cant add the button in the embed
dpy isnt made by the discord team its a api wrapper from danny which he stopped since all of the hate he was getting but theirs forks people have moved to which do have slash commands
not really
I added a space to it, and I'm not getting it o.o
What hate did he get 🥲 🥲
do I need to import something?
Is there a way to add slash commands to discord.py
+ I'm green
- I'm red
its just message MESSAGE CONTENT INTENT will require verification and approval
new line? o.o
the first \n
just the first one, okay
!e
print("Hello\nWorld")
@slate swan :white_check_mark: Your eval job has completed with return code 0.
001 | Hello
002 | World
makes a new line
Plus for me slash commands would make it easier to use because I don't need to remember the prefix or anything
good for you
check the dpy server its a long story
I'm getting this result now :P
You can make a separate view for the close button
I meant I wouldn't need to remember prefixes
is there something I'm missing...? Do I need to import something?
weird
okay okay but how? xD
no not at all
thats a discord code block
seems right
can you send me the official documentation page for this
:P
has anybody got code for color codes? I'm having trouble figuring out how to use this o.o
