#discord-bots
1 messages · Page 952 of 1
@final iron let me show you something funny
!e
print ("no errors!")
@slate swan :white_check_mark: Your eval job has completed with return code 0.
no errors!
Can u both take this to an ot?
what the fuck is that bro just edit my code please dude
try using inspect.Signature
Everyone knows this...

uhh that was for @final iron
Wat
no?
you were asking earlier what a function signature is
Oh yeah
he said it was something dumb i made when its not lmfao
The person dk what they asked for but the helper does 😔

🗿
i knew it was a thing but didn't know you could actually get it from inspect
no
your 🗿 use is excessive imo
i created the 🗿 trend here
I am one with the moyai
but mina🗿
join us 🗿
stay in this channel for a few days and u will know more secrets about the people here
🗿
i am the 🗿 master
if it can be construed as rude or dismissive even in the sliiiiiiiiiightest way i'd rather you guys not
i'm interpreting it as "bruh"
the ultimate moyai!🗿
well i mean it depends on how you interpret it😔
i mean am i wrong?
I mean, that is what the emoji means, sooooooo
no😔
it feels like a mixture of "bruh" and "duh"
I started using it as something sarcastic/to show something is funny or interesting i guess
we're secretless
i don't think we have ever used it in a demeaning way though
more like "bruh" or like "really" like a shocked emotion
i dont use it in a regular basis so i wouldnt know
proof?
i get that a lot of you are friends and are probably fine with it... but even with my close friends i am careful to use language/emoji that is not likely to be misunderstood by third parties as me being rude
can we take this to an OT chat?
*in public channels
sounds like a good idea
I learned my lesson I'm just a saint now

i mean we just do it to joke around mostly... but we never like attack a person or do like if theyre "stupid" but yes i see your point
^
we do it like a bruh moment and then we continue to help the person mostly thats what i do sometimes which is rarely that i use that emoji
yeah i understand. just pls be mindful of it (speaking to everyone here)
yeah us generals should be an example
you mean the regulars? yeah that would be great if you guys set a stellar example :)
Yes!
should I make a replica of discord inside a bot 
how would it be like an html frame 
# Base BTC Command
@commands.group(name = "btc", invoke_without_command = True) # <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
async def btc(self, ctx, *args):
#await ctx.reply("Unknown command: Use `-btc` for help with BTC commands.", mention_author = False)
if ctx.invoked_subcommand is None:
await ctx.reply(embed = helpEmbed, mention_author = False)
# Address Command
@btc.command(name = "addr", aliases = ["address", "a"])
async def btc_addr(self, ctx, addrVal):
await ctx.reply("Test Passed")
Why doesn't my subcommand work unless have invoke_without_command = True (where are the arrows are)
it wouldn't
what's stellar mean
would it be a slow slideshow?
oh star
like an amazing example
means very good, excellent
wdym "generals"?
nvm that i ment it like we are generally always here
ah ok
ok, i'll keep you accountable to that
😭
😳
no
Hey, how can the bot do an action based what a user chose in an disnake.ui.Select (select Menu in discord)? I already created the select menu and attached it to a message. I just need my Bot to do something if a user clicks on an option.
then?
yeah a callback method
depending on your lib theyre would be examples on the repo
^
just text
the value will be stored in the callback function and you can go through the possibilities with if statements to do your thing
alr
Nice idea, imma remember that
perhaps I can find an example
thanks
async def callback(self, interaction):
await interaction.response.defer()
if not interaction.author == self.ctx.author:
return await self.ctx.send(f"**{interaction.author}, nem te.**")
value = self.values[0]
if value == "Január" or value == "Március" or value == "Május" or value == "Július" or value == "Augusztus" or value == "Október" or value == "December":
days = 31
elif value == "Április" or value == "Június" or value == "Szeptember" or value == "November":
days = 30
else:
days = 28
newOptions = [
SelectOption(
label=str(day)
) for day in range(days+1)
]
await interaction.message.edit(
content="**A szülinapod...**",
view=View(
Day(
value,
newOptions[1:16],
self.ctx
),
Day(
value,
newOptions[-(days-15):],
self.ctx)
)
)
await self.ctx.send(f"**A kiválasztott hónap: {value}**")
horrible example
if value in (stuff):
would've made it so much easier
okay I will try it thank you
# Base BTC Command
@commands.group(name = "btc", invoke_without_command = True) # <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
async def btc(self, ctx, *args):
#await ctx.reply("Unknown command: Use `-btc` for help with BTC commands.", mention_author = False)
if ctx.invoked_subcommand is None:
await ctx.reply(embed = helpEmbed, mention_author = False)
# Address Command
@btc.command(name = "addr", aliases = ["address", "a"])
async def btc_addr(self, ctx, addrVal):
await ctx.reply("Test Passed")
Why doesn't my subcommand work unless have invoke_without_command = True (where are the arrows are)
why not do if value in (...)
nvm
yert
why would you defer at the start?
czzz that is when u defer?
it seems unnecessary to me
cuz it lasts more than 3 seconds to answer

its helpful, especially when yr ping is too much. also prevents useless errors
yeah but makes the response slower
Huh?
makes the response work too
since youre waiting it would take a longer time period to respond
who said that
Nvm, I only had to take out *args bc it thought the subcommand was an arg
why isn't this giving me an output?
Can someone help, how do I "translate" this line to disnake library?
@client.slash_command(name = 'timeout', description = "mutes/timeouts a member")
@commands.has_permissions(moderate_members = True)
async def timeout(ctx, member: Option(discord.Member, required = True), reason: Option(str, required = False), days: Option(int, max_value = 27, default = 0, required = False), hours: Option(int, default = 0, required = False), minutes: Option(int, default = 0, required = False), seconds: Option(int, default = 0, required = False)): #setting each value with a default value of 0 reduces a lot of the code
if member.id == ctx.author.id:
await ctx.respond("You can't timeout yourself!")
return
Anybody? - The one with options.
why do you need all these Option stuff
actually, I don't know much about these since I haven't tried them, so I won't say anything stupid
Do you have an error handler?
member is None because you set it to default to that value
Also you're using avatar.url and avatar_url
Pick the one that corresponds to your dpy version
avatar.url would be 2.0
oops
Readability has left the chat
Have you considered using a formatter like black to make it more readable?
IMO it would help a lot
you did not input anything for member
therefore, it's None
you could also check if it's None at the start
a
like:
if member is None:
return await ctx.send("Who?")
oh
remove self from the args
I did overlook that...
you only need self in cogs
and other classes
which you don't have
now it gives me another error
you're on dpy 1.7?
pretty sure you are...
then yes
👍


can i make it so that i don't have to mention myself tho?
oh yes, easy one liner
member = member or ctx.author
so if member is None originally, it will choose ctx.author, which is you
ah
or whoever invokes the command
but it'll still work if i mention someone else tho, right?
then you don't have to check if it's None
yes
in that case, it sets itself to itself
is there a way to get the name of a missing required argument from the exception?
can i also change the author text?
it just shows the person using the commend and not the person mentioned
you used ctx.author instead of member somewhere
i want it to show something like
you#0000 if you are the one using it on yourself and
mentioned user#0000 if you are mentioning someone else
yes
exception discord.ext.commands.MissingRequiredArgument(param)```
Exception raised when parsing a command and a parameter that is required is not encountered.
This inherits from [`UserInputError`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.UserInputError "discord.ext.commands.UserInputError")
i tried to but it gives an error
member.name and member.discriminator?
yes
how come
@gilded zephyr this error does have a param attribute
!d discord.ext.commands.MissingRequiredArgument.param
The argument that is missing.
ah i see
i forgor ctx isn't needed as it's member
yes it works now
Guys, how can i off the delete? if i ban someone the bot delete the message history
@commands.has_permissions(ban_members=True)
@client.command(name="ban")
async def ban(ctx, member : discord.User, *,reason = "No reason was provided"):
banhammer=":ban_hammer:"
reason = "".join(reason)
embed=discord.Embed(title=f"{member} Banned from {ctx.guild.name} {banhammer}", description=f"\nModerator:{ctx.author.mention}\nreason: {reason}\nTime: ∞",color=0x34568B,timestamp=ctx.message.created_at)
embed.set_thumbnail(url=member.avatar_url)
embed.set_footer(icon_url=member.avatar_url, text=f"{member.name} | {member.id}")
await ctx.send(embed=embed)
await ctx.guild.ban(member,reason=reason)
Use the delete_message_days keyword argument
ban(member, reason=reason, delete_message_days=0)
thank you
👌
it's supposed to say
"You are ..." if you don't mention anyone and
"<mentioned_user> is ..." if you mention someone (also i want it to only say the name without the discriminator)
Use member.name
member is never None
you set it to ctx.author if it's None
remove member = member or ctx.author here
or you could
member = member or "you"
and you won't need the if statement anymore
hello mina
some of those words aren't appropriate for here fyi
hi
tbh you didn't need to send the list
description={message.content},
``` Why does this send my message like this:
How?
cuz that's how you define a set
if you want it to be an str, just don't convert it to a set
description=message.content,
oh
ty
@commands.Cog.listener()
async def on_message(self, message):
try:
if ".close" in message.content:
pass
else:
if str(message.channel.type) == "private":
return
else:
if message.author == self.client.user:
return
else:
user = await message.guild.fetch_member(int(message.channel.name))
emb = discord.Embed(
title=f"{message.author.name}#{message.author.discriminator}'s Response",
description=message.content,
timestamp= datetime.utcnow(),
color = discord.Color.green()
)
await user.send(embed=emb)
except Exception as e:
print(e)
pass
``` How do I make it so it doesn't do this on *every* message
int(message.channel.name)
See anything wrong?
how do you convert the channel's name to a number
That I had type?
?
use isinstance
and why do you fetch a member
Did not really know how to do it else
I don't have that, hm?
Yes you do
oh i was in the wrong file
Someone who knows how to make an giveaway bot with invite requirements?
Not really, sorry
anyone use Disnake library?
yea
i need help
i'll send here my question
@commands.slash_command(description="Send the 10 latest videos of CodeWithVincent youtune channel.")
async def latestVideos(self, inter):
view = disnake.ui.View()
item = disnake.ui.Button(
style=disnake.ButtonStyle.blurple,
label="Test",
emoji=":fast_forward:",
custom_id="Next-btn"
)
view.add_item(item=item)
msg = await inter.response.send_message(embed=embed, view=view)
interaction = await self.bot.wait_for("button_click", timeout=60, check=lambda inter: item.custom_id == "Next-btn")
@commands.Cog.listener()
async def on_button_click(self, interaction):
x = await interaction.original_message()
embed = disnake.Embed(
title='Yes :)'
)
await x.delete()
@final iron It's now not working anymore as well
how to edit or delete original message interaction on_button_click
!e
int("channel name")
@final iron :x: Your eval job has completed with return code 1.
001 | Traceback (most recent call last):
002 | File "<string>", line 1, in <module>
003 | ValueError: invalid literal for int() with base 10: 'channel name'
Keep getting this when typing in the ticket, it should dm the user with my response
!d disnake.Interaction.edit_original_message
await edit_original_message(*, content=..., embed=..., embeds=..., file=..., files=..., attachments=..., view=..., components=..., allowed_mentions=None)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).
Edits the original, previously sent interaction response message.
This is a lower level interface to [`InteractionMessage.edit()`](https://docs.disnake.dev/en/latest/api.html#disnake.InteractionMessage.edit "disnake.InteractionMessage.edit") in case you do not want to fetch the message and save an HTTP request.
This method is also the only way to edit the original message if the message sent was ephemeral.
Note
If the original message has embeds with images that were created from local files (using the `file` parameter with [`Embed.set_image()`](https://docs.disnake.dev/en/latest/api.html#disnake.Embed.set_image "disnake.Embed.set_image") or [`Embed.set_thumbnail()`](https://docs.disnake.dev/en/latest/api.html#disnake.Embed.set_thumbnail "disnake.Embed.set_thumbnail")), those images will be removed if the message’s attachments are edited in any way (i.e. by setting `file`/`files`/`attachments`, or adding an embed with local files).
Is essentially what you're doing
disnake.errors.NotFound: 404 Not Found (error code: 10015): Unknown Webhook
How to fix it erm
Remove the line?
idk if u got the answer but it should be f'{message.content}'
you don't convert the name to a number, in fact, you shouldn't use name but id
I had that but I got told off to change it back
you shouldnt, cause that works
even tho if you have the id, you should have the memebr object originally
ik but it gave me another error
unnecessary f-strings are bad
like interaction has no response
So what do I do to get it fixed so it doesn't do this the whole time and send the message back in dms
@maiden fable
mind showing the error?
ok
You're using int() on the channel name
Should it be a str?
user = await message.guild.fetch_member(int(message.channel.name))
``` You are talking about this line, right?
Yes
you are fetching a guild's member by the name of a channel
these two are completely unrelated
who do you want to send the message to
which user
@commands.Cog.listener()
async def on_button_click(self, interaction):
embed = disnake.Embed(
title='Yes :)'
)
await disnake.Interaction.edit_original_message(self, embed=embed)
AttributeError: 'SlashLatestVideos' object has no attribute '_state'
nah, this line never worked
idk how to use Interaction.edit_original_message
interaction.edit_original_message
Yep it did...
interaction is a disnake.Interaction
perhaps you want to send a message to ctx.author?
or a member variable?
Then you changed the code
To the users dm
which user bro
The one that made the ticket
They dm the bot, the bot makes a channel, if I type something in that channel it gets send to them
@commands.Cog.listener()
async def on_button_click(self, interaction):
embed = disnake.Embed(
title='Yes :)'
)
await interaction.edit_original_message(embed=embed)
disnake.errors.InteractionNotResponded: This interaction hasn't been responded to yet
sure
import discord
from discord.ext import commands
from datetime import datetime
class Mod(commands.Cog):
def __init__(self, client):
self.client = client
@commands.Cog.listener()
async def on_ready(self):
print(f"{self.__class__.__name__} Cog has been loaded\n-----")
@commands.Cog.listener()
async def on_message(self, message):
try:
if ".close" in message.content:
pass
else:
if str(message.channel.type) == "private":
return
else:
if message.author == self.client.user:
return
else:
user = await message.guild.fetch_member(str(message.channel.name))
emb = discord.Embed(
title=f"{message.author.name}#{message.author.discriminator}'s Response",
description=message.content,
timestamp= datetime.utcnow(),
color = discord.Color.green()
)
await user.send(embed=emb)
except Exception as e:
print(e)
pass
@commands.command()
async def close(self, ctx):
user = await ctx.guild.fetch_member(int(ctx.channel.name))
await user.send("Modmail has been closed by the support team")
await ctx.channel.delete()
def setup(client):
client.add_cog(Mod(client))
import discord
from discord.ext import commands
from datetime import datetime
class Modmail(commands.Cog):
def __init__(self, client):
self.client = client
@commands.Cog.listener()
async def on_ready(self):
print(f"{self.__class__.__name__} Cog has been loaded\n-----")
@commands.Cog.listener()
async def on_message(self, message):
if str(message.channel.type) == "private":
if message.author == self.client.user:
return
else:
guild = self.client.get_guild(867086205182017536)
channels = await guild.fetch_channels()
channel = discord.utils.get(channels, name = str(message.author.id))
if channel is None:
category = discord.utils.get(guild.categories, name="Tickets")
channel = await guild.create_text_channel((message.author.name),category = category)
await message.author.send("Modmail has been created succesfully")
em = discord.Embed(
title=f"{message.author.name}#{message.author.discriminator} created a modmail",
description= message.content,
timestamp = datetime.utcnow(),
color = discord.Color.dark_blue()
)
await channel.send(embed=em)
await channel.send("<@&868232863592620072>")
else:
em = discord.Embed(
title=f"{message.author.name}#{message.author.discriminator} created a modmail",
description= message.content,
timestamp = datetime.utcnow(),
color = discord.Color.dark_blue()
)
await channel.send(embed=em)
def setup(client):
client.add_cog(Modmail(client))
@maiden fable
yep sorry @glad cradle
elif reaction.emoji == u"\u23E9":
if current <len(bot.help_pages)-1:
current += 1
elif reaction.emoji == u"\u2197":
if current = len(bot.help_pages)-1
for button in buttons:
await message.remove_reaction(button, ctx.author)
problem - ',' or '(' or ')' expected
meh told u bro
user = message.author
instead of
user = await message.guild.fetch_member(str(message.channel.name))
@junior verge
channels = await guild.fetch_channels()
channel = discord.utils.get(channels, name = str(message.author.id))
```this also doesn't make any sense
I just love it how people who ask for help tend to ignore many times and we just keep on pinging them haha
unless you have a channel named after the user's id
it doesn't work
disnake.errors.InteractionNotResponded: This interaction hasn't been responded to yet
Respond to the interaction
hm that's weird
i need to respond to an interaction?
(Not attacking anyone. just a general thing)
and Daxles, you make too many unnecessary API calls
fetching is almost never necessary
1s, where?
uh sorry I guess?
import ctx as ctx
import discord
import asyncio
import os
from async_timeout import timeout
from discord import message
from discord.ext.buttons import buttons
from dotenv import load_dotenv
from discord.ext import commands
load_dotenv()
TOKEN = os.getenv("TOKEN")
bot = commands.Bot(command_prefix='.', help_command=None)
@bot.event
async def on_ready():
print("Bot is now ready to shut up discord from unwanted users")
@bot.command(pass_context=True)
async def clear(ctx, amount=10):
channel = ctx.message.channel
messages = []
async for message in bot.logs_from(channel, limit=int(amount)):
messages.append(message)
await bot.delete_messages(messages)
#help pages
page1 = discord.Embed(title='Bot Help 1', description='Use the buttons below to navigate pages.', colour=discord.Colour.orange())
page2 = discord.Embed(title='Bot Help 2', description='Page 2', colour=discord.Colour.red())
page3 = discord.Embed(title='Bot Help 3', description='Page 3', colour=discord.Colour.green())
bot.help_pages = [page1, page2, page3]
@bot.command()
async def help(ctx):
buttons = [u"\u23E9", u"\u23EA", u"\u2197", u"\u2196"]
current = 0
msg = await ctx.send(embed=bot.help_pages[current])
await msg.remove_reaction(reaction.emoji, ctx.author)
while True:
try:
reaction, user = (await bot.wait_for("reaction_add", check=lambda reaction, user == ctx.author and reaction.message == msg and
reaction.emoji in buttons, timeout=60.0)
except asyncio.TimeoutError:
embed = bot.help_pages[current]
embed.set_footer(text="Timed Out.")
await message.clear_reactions()
else:
previous_page == current
if reaction.emoji == u"\u2196":
current = 0
elif reaction.emoji == u"\u23EA":
if current > 0:
current -= 1
elif reaction.emoji == u"\u23E9":
if current <len(bot.help_pages)-1:
current += 1
elif reaction.emoji == u"\u2197":
if current = len(bot.help_pages)-1
for button in buttons:
await message.remove_reaction(button, ctx.author)
if current != previous_page:
await message.edit(embed=bot.help_pages[current])
client.run(TOKEN)
Someone who knows how to make an giveaway bot with invite requirements?
it's literally your code, you have to know where it is 😭
Replace what with what I am confused
Someone who knows how to make an giveaway bot with invite requirements?
you can ping me btw idm
oh it was
await interaction.response.edit_message(embed=embed)
import ctx as ctx?
how to make a twitch live alert in discord bot?
I know but what about Conditions?
@cold sonnet I am confused man
@junior verge
Thorowin errors
umm wait
Theres no line 46
can i check who pressed a button?
not u
interaction.member?
sorry 😩
Hello, how would I make my bot delete its old output when the user edits their command
its old output as in?
That's the user who used the cmd slash
On line 27?
idk, but doesn't matter in opposition to your error
I have
async def on_message_edit(before, after):
await bot.process_commands(after)```
But I want the bot to delete the old response before outputting the new response
it would show that "you" is not defined if i do that
you have to store the old response Majixed
uh how
did you forget the quotation marks
so for example if I say, $help, the bot sends the help page. And if I edit $help to $ban the bot should delete the help page, and execute the ban command afterwards
I've got interaction.author here on the docs
no
@sharp snow
so you can use await stored_variable_of_the_message.delete()
i also have to mention myself if i change it to that and it'll also still just say my name instead of "you"
more like an instance of a message object
remove .name
Ah I see
I was happy that you're finally here and this is all you tell me

your happy im here? how cute

I am
yeah thought I wouldn't have to carry on with 5 guys

But the thing is, I want this to be the case for every command the user runs, not just one specific command. How do I store the output of the previous command? Is there a name for it?
but if i do that, it'll show the discriminator as well, also the "you is" 🗿
the output of what?
you is a SAO fan.*
Basically the message the bot sends in response to a command
no, would you say "a hour" or "an hour"?
remove that
okay
and put your if statement back
🗿
this without member = member or ctx.author
and the inappropriate words are what we don't care about in this picture
you can remove a return aswell
that could can be so much better ngl
the coroutine .send() of the Context class returns a message obj so just store it
removing {} around the last item of the list?
talking about this
no the if statement and the else statement
Not only of Context but abc.Messageable.send
!d discord.abc.Messageable.send
await send(content=None, *, tts=False, embed=None, embeds=None, file=None, files=None, stickers=None, delete_after=None, nonce=None, allowed_mentions=None, reference=None, ...)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).
Sends a message to the destination with the content given.
The content must be a type that can convert to a string through `str(content)`. If the content is set to `None` (the default), then the `embed` parameter must be provided.
To upload a single file, the `file` parameter should be used with a single [`File`](https://discordpy.readthedocs.io/en/master/api.html#discord.File "discord.File") object. To upload multiple files, the `files` parameter should be used with a [`list`](https://docs.python.org/3/library/stdtypes.html#list "(in Python v3.10)") of [`File`](https://discordpy.readthedocs.io/en/master/api.html#discord.File "discord.File") objects. **Specifying both parameters will lead to an exception**.
To upload a single embed, the `embed` parameter should be used with a single [`Embed`](https://discordpy.readthedocs.io/en/master/api.html#discord.Embed "discord.Embed") object. To upload multiple embeds, the `embeds` parameter should be used with a [`list`](https://docs.python.org/3/library/stdtypes.html#list "(in Python v3.10)") of [`Embed`](https://discordpy.readthedocs.io/en/master/api.html#discord.Embed "discord.Embed") objects. **Specifying both parameters will lead to an exception**.
yeah since its a subclass
oh just removing the else
yeah since hes returning already
member = f"{member} is" if member else "you are"
..
return await ctx.send(f"{member} {random.choice(wai_list)}.")
lol
gotcha = 
looks bad
nah it doesn't lmao
You're right sorry
make it a one liner
return await ctx.send(f"{f'{member} is' if member else 'you are'} {random.choice(wai_list)}.")
@slate swan and this?
it ain't even right
use " and '
Pls help
don't make a command named discord
seems like Command is discord for some what reason
Ohh
you can use the name kwarg in @bot.command() though
yeah
Wasn't even sure you could do if comps like that in format string lol
how to edit webhook when a specific button was pressed, can i use on_button_click??
@bot.command(name="discord")
async def randomfunctionnamelmao():
#pass
use ellipses
yeah, just with '
Yeah true i edited
nice
its always like that you can only use singles inside of doubles and doubles inside singles
I'm single
im talking about quotes
Not true
how exactly?
!e ```py
print(""""""""""""""""""""""")
@cloud dawn :white_check_mark: Your eval job has completed with return code 0.
"""""""""""""""""""""
!e
print("And he said, \"its always like that you can only use singles inside of doubles and doubles inside singles\" funniest stuff I ever heard!")
@sick birch :white_check_mark: Your eval job has completed with return code 0.
And he said, "its always like that you can only use singles inside of doubles and doubles inside singles" funniest stuff I ever heard!
without the \ 
lmao
but don't do that
you have to keep those bytes
so use '
i am struggling to read documentation rn
which
smort
so i'm reading this and it's obvious how this works but then i go to view
and im just like uhhhh
how to edit a webhook when a specific button was clicked? can i use on_button_click? (there are 3 buttons)
what's the issue
@bot.event
async def on_dropdown(interaction):
pass
``` called when any select menu is clicked
use callbacks
yeah that's better
it should be in the View class
read the note
disnake.ui.Button.callback?
yeah it says to use the callback function of the view, not this
cuz this is bad, callback good
you can just create a subclass and make your own callback

callback by when a button is clicked it gets called back to the method
The same callback method that is stated above is our event
you can use both
the callback of the view would be specifically for that view
the event would just tell you that one of your views was clicked
the callback of the component.
it's like
not the view
local errors for a command and an on_command_error
me saying all this with just my brain, not even bothering to try it out
yes
don't u dare tell me it's wrong
which of all
replace view with a component in every message
what
nah then it don't make sense
a View is a container of components
yeah that should be right
when a select menu is clicked
so yes
how does it even fetch that information
what?
how does it know when you click it without selecting an option
let me check payload
so i could essentially do
class View:
async def interaction_check(interaction):
#common code that runs on all interactions such as checking author of message is the interacting author
then use on_dropdown for the rest
Might want to check Twitch API, if they have one
They do
and whatever the button one is etc.
nah you gotta inherit discord.ui.View
They are more focused towards streamers tough.
all of it
oh
its just a gateway events and its response body how is that hard to read?
cuz Ion even know where to start
and its formatted in json
Pretty bad there isn't a comment whether it's a POST or GET
the name of the event?
INTERACTION_CREATE
probably a post
INTERACTION_CREATE most likely
yeah
god I have to learn

The websocket gateway?
"nick": null,
why even null it's not even python-like
welp, im just gonna ignore view and use the on_ methods
bro its formatted in json💀
Connecting to it manually without a wrapper teaches you a lot
IDK JSON
Pretty sure it's actually string
But formatted as a JSON so it can be parsed by both parties
this is a payload thats sent by the gateway ofc it wont be python like
You can also agree on ETF iirc and use zlib compression
ok js boy
Can anyone help me with discord_ui stuff?
You need to agree on the data format on start
Sure. What's the issue?
Why cant i add View from discord-ui?
Error:
File "main.py", line 8, in <module>
from discord_ui import Button, view
ImportError: cannot import name 'view' from 'discord_ui' (/opt/virtualenvs/python3/lib/python3.8/site-packages/discord_ui/__init__.py)```
Code:
```py
from discord_ui import Button, view
"username": "uyy ese hombre",
nah bro this is getting inhumane
It's discord.ui
Usually though you'd want to import
from discord import ui
and use ui.Button or ui.Select to not pollute the namespace
with what?
means ey that man
not with json
I'm confused
So lost

we all are confused
i wish the select menus on desktop actually had a submit button next to them
from discord import ui, ui.Select
^
SyntaxError: invalid syntax```
Not quite
Once you import it you can use it within your code as ui.Button or whatever it is
submit like the send button discord provides?
or are you referring to something else
im confused
Yea, then you'd be able to press more than one option at a time
okay so in this json, the whole d var is the interaction, then that interaction has the message with content and components and stuff
yknow how it automatically sends an interaction when you pick one or more options then close the dropdown
from discord import ui
class MyView(ui.View):
...
class MyButton(ui.Button):
...
class MySelect(ui.Select):
...
and the message has an interaction and a view
its so annoying cause you cant select the same option twice or 0 options
have you never read a apis json response body😭
Yeah
view has components which have components
yes
never bro
Component jsons are very messy
I tried to make them the first day modals came out since no libs supported them yet
that is my livelihood
same
in fact, dpy is the first api I use and it's quite good for learning
Ive put it in but it still gives me errors
discord API's official documentation kind of sucks
I really suggest you try to set up your own connection with the websocket, it's a very good learning experience and you get an understanding of how discord's API actually works
the fun part is parsing the response body thats hella messy 
import pycord doesn't exist
Also why are you importing pycord AND discord
cuz pycord uses the name discord
Robin do you have an api that uses websockets or know of mr.js 
which is good, useful and understandable
i've been trying to solve this for the past 30 minutes by trying new ways but it isn't working, it isn't giving an output but it also isn't giving an error
@client.command()
async def cr(ctx, member:discord.Member=None):
if member is None:
return await ctx.send(embed = discord.Embed(title="cool rate", description = f"You are {random.randrange(101)}% Cool 😎", color = 0xffffff))
else:
return await ctx.send(embed = discord.Embed(title="cool rate", description = f"{member.name} is {random.randrange(101)}% Cool 😎", color = 0xffffff))
Made a chat app once with websockets
i want to wrap an api with websockets and use aiohttps websocket support
Do it on discord's api
this can be a one liner
i was gonna fork rin but its kinda advance for me (too lazy to read src)

but how can i do it if i want it to change the embed's description
Update to 2.0
wait nevermind, i might have an idea
Fork rin and finish it for me
i cant, i still have allot to learn master
How do i update it because the new one is discord-ui Right?
Pretty much everything is done for you already
No lmao. It's just discord.ui
oh
@client.command()
async def cr(ctx, member:discord.Member=None):
await ctx.send(embed = discord.Embed(title="cool rate", description = f"{'You are' if member is None else f'{member.name} is'} {random.randrange(101)}% Cool 😎", color = 0xffffff))
i need to learn the attr deco thing for slots
so how do i update it to 2.0
It's just a lower level dataclass
tbh i thought i did it
@pliant gulch I meant to ask you but, you are you heartbeating and polling for websocket messages concurrently using async? I always had trouble with that. Create_task?
thats the thing i still need to learn dataclasses
I haven't even added the "joke" to cursecord yet and there are already downloads
💀
Check the github page for instructions
In rin yes the heartbeating is using create_task
kk
I thought as much, I tried that but it won't keep heartbeating until I await it, and I can't await both the heartbeat and constant polling for messages
Do you have some code I can look at?
@spice basalt try this and if no output, try to remove your error handler
if you don't have an error handler, well....
heartbeat_task = create_task(heartbeater())
poll_task = create_task(poller())
await heartbeat_task
await poll_task
like that for instance
It would get hung up on await heartbeat_task because it's a while true loop
And it never returns
Without awaiting it the programs quits after creating the tasks
You would have to do ```py
hearbeat_task = create_task(...)
await poller()
i just got ratelimited
🗿
lmao
You don't need to await for the heartbeat task, logically
So you don't need to await
You can call it without await?
Yes
But it's a coroutine
You don't need to await it in this case though
i'm just gonna sleep and continue when i wake up
You'd get an error wouldn't you?
yea the point of create_task is that it gets scheduled in the event loop, so at any opportune moment while you're awaiting something else, your task can run
Yeah since heartbeating is only done like every 45 seconds so it's like 99% IO
Same with your case, you don't need to AWAIT the task
So, just schedule it, then await your poll
Oh. that makes more sense. Before I was trying either not awaiting either or awaiting both of them
Never occured to me to just await the polling
async def coro(...) Is a coroutine function. You call it, so coro() then that creates a coroutine object, you then await that. That's what the code is really doing
If that was what you were talking about that is ^
hmm maybe ill look into connecting to the gateway too, always wanted to learn more about sockets
Fork rin and finish it for me 🙏
Ah okay. Thanks for that, I'll try your approach later today 😄
Im pretty sureive updated it now but i still get the error
File "main.py", line 5, in <module>
import discord.ui as disc
ModuleNotFoundError: No module named 'discord.ui'
```
finish it danny
No I'm working on cursecord now
you left the lib in the ground so finish it
April fools joke, better done then never
@sick birch ?
youre a joke for not finishing rin
Finish it for me then
🏃♂️
oh hi andy
ill look at its src later so except questions from me
Your on your own
2 busy procrastinating
fine😡
All you really have to do is add models
which are you missing
and you already did base models right 
All of them except for a few
sqlite doesnt work with bots right?
https://github.com/an-dyy/Rin/tree/master/rin/models just look at them
ill look into them
what's cursecord
Good luck I basically left you a dumpster fire
it does it hudt can block your bot
My late april fools joke wrapper ```py
import cursecord
async def main() -> None:
guild = cursecord.Guild.precreate(id=...)
async with cursecordCursedClient(....) as (client, gateway, rest):
@gateway.on(cursecord.MESSAGE_CREATE)
async def message(message: cursecord.Message) -> Iterator[str]:
yield f"I got a message from {message.author}"
@guild.on(cursecord.GUILD_DELETE)
async def deleted(guild: cursecord.Guild) -> None:
print("deleted")
await gateway.setup()
asyncio.run(main())
which i can heat myself up with 
there's asyncronous sqlite libraries right
!pypi aiosqlite
yeah
@slate swan does sqlite work doe
ohh
aiosqlite is sqlite
yes but just use its async bridge
ah ok
why it doesn't use #959231793393967144 
I will be attempting to make cursecord work later
Haven't finished procrastinating yet
it doesnt have a ratelimiter right
no dont make one
how to make a twitch live alert in discord bot
please this is the third time im asking
We already told you, use the twitch API
Hey quick question, is there a reason why slash commands aren't showing up? I figured I might be doing something wrong, so I tried one of those templates, but nothing pops up, no errors or anything.
from discord import app_commands
@tree.command(guild=discord.Object(id=507364684924452896))
async def slash(interaction: discord.Interaction, number: int, string: str):
await interaction.response.send_message(f'{number=} {string=}', ephemeral=True)
Did you sync?
Oh?
making a slash command only updates the local tree
You need to sync those changes over discord
Oh, I see, how would I do that?
In your on ready, you can do like tree.sync()
!d discord.app_commands.CommandTree.sync
await sync(*, guild=None)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).
Syncs the application commands to Discord.
This must be called for the application commands to show up.
Global commands take up to 1-hour to propagate but guild commands propagate instantly.
When using buttons is there a way to just view one button instead of the entire class of buttons?
What do you mean?
like bro i can only do print command
That was all of us at one point or another
I'm assuming something like
await tree.sync(guild=None)
``` this?
Specify a guild
Yeah maybe but idk how to learn utube doesn't work
Global slash commands can take up to an hour to propagate
That's the problem
Youtube sucks for coding tutorials
Howu learn?
You do all these tutorials and follow along, then the times comes to do something yourself and you have no idea what to do
does anyone know how to make the bot DM a new member ?
That's because you just copy down what the youtuber says without really thinking about it. Even if you think about it it isn't very efficient and you're not going to end up learning anything
Easy. on_member_join paired with member.send(...)
thanks
i don't think im gonna learn it
then ?
Those will never work
Attempt a project. Keep googling until you get it. Over time you start to understand how to do things
Whatever you do, stay off youtube tutorials
I learned by reading source code 👁️👁️
That's how many of us learn. By doing projects we like, breaking things, fixing things, breaking things, deleting the whole project, starting over, breaking it
And yes, this too. Looking at other people's code
Like when using ```py
view=Counter()
is it like this?
Find a professional project on github written in python, go looking around the code and see how others do it
k
If you want just one button you can do something like
class MyView(discord.ui.View):
def __init__(...):
...
@discord.ui.button(...)
async def callback(...):
...
is that for a button?
But that just has one button in the class and there have five in mine and I just want to post one for that single command
True. Smaller repos aren't always made by people who know what they're doing, and may have bad practices so you need to be careful about that
Oh I think I see. Yeah, if you want to send just one button you have to make another view subclass
Or do it dynamically by subclassing BOTH view AND button
Guess I got some research to do on subclasses
Maybe jumping in head first to that isn't the best idea when you said you only know how to make print statements
I don't mean mega as in size, I mean like mega repositories that big tech companies have, such as google
Meaning one repo with all their stuff in it, etc
@sick birch
did you defer?
Mono repo vs Mega repo^
huh
They want to make a bot just like that
I see, yeah
"This interaction failed" is weird cuz it legit gives no information
but ig it's worth a try defering
Well, as far as discord cares you didn't respond. So it failed
async def callback(self, interaction):
await interaction.response.defer()
There's only one way for an interaction to fail, that is your bot didn't respond to an interaction, so no information is necessary on discord's side
why that many indents
About how long does it take to sync?
wth is that
what where are the callbacks of those
what is that
Code?
Wdym
I mean you asked what that is. It's code, for those pictures you sent us
A subclass is just ```py
class test ()
def Counter()
Right?
uh
yes it is
Not quite that's a regular class
class Test(Counter): ...
and bad syntax
I don't think that's their code
so this?? py class Music(Counter, discord.ui.View):
Yeah it's the code for the pictures i sent
yeah that seems good
They said earlier they were new and only knew how to do print statements. Later they sent a few pictures of a verified bot functionality, then that code matches up with it
Music doesn't seem that good, but this is python
This goes underneath the current clash right
If I'm to guess that code is for a verified bot which is very disappointing
okay if that code is for a verified bot I don't know what I'll do
it's my own
Oh nevermind, I was looking at the wrong bot in this picture
we were rude
Nah. Constructive critism
Oh I don't know why I wanted to make parrot noise music commands LOL this is stupid
the first four lines of the command can be replaced with
if "ticket" in channel.name:
you saved 3 variables
r u talking to me?
yes
I just get counters not defined with this
I only recommend making extra variables and wasting memory if it improves readibility. In this case it reduces readibility AND wastes memory
Whoa. Multiple inheritance
Ive just got an error and i dont understand it
??
he says cool
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/http.py", line 300, in static_login
data = await self.request(Route('GET', '/users/@me'))
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/http.py", line 254, in request
raise HTTPException(r, data)
discord.errors.HTTPException: 401 Unauthorized (error code: 0): 401: Unauthorized
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "main.py", line 211, in <module>
client.run(TOKEN)
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/client.py", line 723, in run
return future.result()
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/client.py", line 702, in runner
await self.start(*args, **kwargs)
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/client.py", line 665, in start
await self.login(*args, bot=bot)
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/client.py", line 511, in login
await self.http.static_login(token.strip(), bot=bot)
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/http.py", line 304, in static_login
raise LoginFailure('Improper token has been passed.') from exc
discord.errors.LoginFailure: Improper token has been passed.
```
Are you sure you want to do multiple inheritance? I've seen that maybe twice in my life
"discord.errors.LoginFailure: Improper token has been passed."
that token is invalid
What's not to understand about that?
usually the error in your code is on the last few lines
But it requires the Discord UI to work
I'm guessing you were looking at the top with the 401 unauthorized
But it also needs to be a subclass
nah cuz u see a lot in dpy source code
yes, and do you NEED to subclass Counters?
Yes, for sure. I'm talking about in regular bot code
Also need to make sure you NEED it
No point in multiple inheritance if you don't need it. I guess that's true for most things so it's redundant
There's no point doing it unless you actually need it, often it will just cause cryptic error messages like "cannot create a consistent mro", usually just instantiating the other class as an attribute is fine
Yes it will save me a lot of work trying to figurer out something else
Ho do i make it so that when the user clickes on a reaction role it DMs Them?
Well to use the buttons you need the UI and that's what that's there for
Maybe not. Can you explain what that something else is? There's a good chance you don't really need to have multiple inheritance going
you mean like, if a user reacts to a message it gives them a role and dms them?
which part do you need help with in this action?
Wouldnt it make more sense to just have a class that utilises Counter instead of inheritance?
But why do you need to subclass Counter AND discord.ui.View?
It's for the button subclass

Ive got the roles part sorted but its the DM
!d discord.Member.send
await send(content=None, *, tts=False, embed=None, embeds=None, file=None, files=None, stickers=None, delete_after=None, nonce=None, allowed_mentions=None, reference=None, ...)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).
Sends a message to the destination with the content given.
The content must be a type that can convert to a string through `str(content)`. If the content is set to `None` (the default), then the `embed` parameter must be provided.
To upload a single file, the `file` parameter should be used with a single [`File`](https://discordpy.readthedocs.io/en/master/api.html#discord.File "discord.File") object. To upload multiple files, the `files` parameter should be used with a [`list`](https://docs.python.org/3/library/stdtypes.html#list "(in Python v3.10)") of [`File`](https://discordpy.readthedocs.io/en/master/api.html#discord.File "discord.File") objects. **Specifying both parameters will lead to an exception**.
To upload a single embed, the `embed` parameter should be used with a single [`Embed`](https://discordpy.readthedocs.io/en/master/api.html#discord.Embed "discord.Embed") object. To upload multiple embeds, the `embeds` parameter should be used with a [`list`](https://docs.python.org/3/library/stdtypes.html#list "(in Python v3.10)") of [`Embed`](https://discordpy.readthedocs.io/en/master/api.html#discord.Embed "discord.Embed") objects. **Specifying both parameters will lead to an exception**.
you have payload, right? @obtuse ridge
it would make more sense, from the very limited info I have, perhaps to do this:
class Music(ui.View):
def __init__(self, ...):
self.counter = Counter()
iirc the person had a view with 5 buttons, but only wanted to send one of those on a specific occasion
So I can see why they think that's necessary
You can either make a seperate subclass just for that one button, or subclass both button and view and make it dynamic
i dont get this, sorry im realy new
show us what you have elio
class MyButton(ui.Button):
def __init__(self, multiple: bool):
if multiple:
self.add_item()
self.add_item()
self.add_item()
self.add_item()
else:
self.add_item()
@discord.ui.button(...)
async def callback(...):
...
@client.event
async def on_member_join(member):
member.send("Example")
The reaction role works ive used it using another bot
Another problem I was having on the why I wanted it inside the music classes because I have my q define in there but one of the buttons requires it
@client.event
async def on_member_join(member):
await member.send("Example")
perhaps
what did you do
join the sever
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.
whats that
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)
this is the only part you gotta read
so do i add that to my code?
Like what?
you already have most
anyone know a good api for nsfw without uh.. cartoons
so now do i try it?
if you did it right, yes
anyone who answers this has to be ashamed
Wooooo, it worked
nice 👍
not really
im tryna make a discord bot for a huge community and the owner requested that xD
ew
you must be incredibly young if thats disgusting to you
youre gonna do/see it more than likely in ur life
hahah
this isnt the point, do u know one or not lol
no
If anybody's got a solution to this I can probably do without the other parts
open a help channel for the best chances of getting help
It relates to Discord bots though they're just going to tell me to come here
tell them we have absolutely no idea
how do i get this to work?
trying to respond to a button interaction in disnake with this
@client.event
async def on_member_join(member):
await member.send(embed=embed)
embed=discord.Embed(title=" You have been successfully verified!", description="Thank you for joining - we hope you enjoy your stay.", color=0x00ebff)
keep getting disnake.errors.InteractionNotResponded: This interaction hasn't been responded to yet
disnake.errors.NotFound: 404 Not Found (error code: 10015): Unknown Webhook
indent the embed part correctly
and switch it with member.send so it's in a good order
@client.event
async def on_member_join(member):
embed=discord.Embed(title=" You have been successfully verified!", description="Thank you for joining - we hope you enjoy your stay.", color=0x00ebff)
await member.send(embed=embed)
interaction.message.edit works as it should but obviously doesn't respond so it gives the interaction failed thing
ok ill try thanks
interaction.response.message.edit or something like this
Imma look it up for you
!d discord.InteractionResponse
class discord.InteractionResponse```
Represents a Discord interaction response.
This type can be accessed through [`Interaction.response`](https://discordpy.readthedocs.io/en/master/interactions/api.html#discord.Interaction.response "discord.Interaction.response").
New in version 2.0.
!d disnake.Interaction.response
Returns an object responsible for handling responding to the interaction.
A response can only be done once. If secondary messages need to be sent, consider using followup instead.
it didnt send anything
!d disnake.InteractionResponse.edit_message
await edit_message(*, content=..., embed=..., embeds=..., file=..., files=..., attachments=..., allowed_mentions=..., view=..., components=...)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).
Responds to this interaction by editing the original message of a component interaction or modal interaction (if the modal was sent in response to a component interaction).
Changed in version 2.5: Now supports editing the original message of modal interactions.
Note
If the original message has embeds with images that were created from local files (using the `file` parameter with [`Embed.set_image()`](https://docs.disnake.dev/en/latest/api.html#disnake.Embed.set_image "disnake.Embed.set_image") or [`Embed.set_thumbnail()`](https://docs.disnake.dev/en/latest/api.html#disnake.Embed.set_thumbnail "disnake.Embed.set_thumbnail")), those images will be removed if the message’s attachments are edited in any way (i.e. by setting `file`/`files`/`attachments`, or adding an embed with local files).
get documentationed
thanks, i think i see it in attributes
it didnt send anything
🤨
I don't know how that's possible
@client.event
async def on_member_join(member):
embed=discord.Embed(title=" You have been successfully verified!", description="Thank you for joining - we hope you enjoy your stay.", color=0x00ebff)
await member.send(embed=embed)
This it right?
should definitely be
nope
@obtuse ridge what are you trying to do
did you change another part of the code
nope
I don't think he does bro
There can be no other issues rather than simple DM failure
Which can get eaten by a bad error handler
for what reason
How can I manually raise UserInputError so that my global error handler handles it?
disabled DMs?
well on_command_error doesnt catch errors from events, on_error does
Make it inherit CommandError and simply raise
Ah yes
Nvm found it, thanks 👍
Would globally defining it help me?
@bot.event
async def on_member_join(member):
welcome_channel = bot.get_channel(933181947700732004)
await welcome_channel.send(f"{member.mention} has joined us!")
await member.send("Welcome!")```
It's not doing anything
Is members intent enabled both in code and on dev portal
I can't think of anything else
its pretty easy to get it wrong the first time
Member intents arent enabled
@bot.command()
@commands.has_role("Franchise Owner")
async def Promote(ctx, user: discord.Member):
guild = ctx.guild
GM = discord.utils.get(guild.roles, name="General Manager")
HC = discord.utils.get(guild.roles, name="Head Coach")
Nor = discord.utils.get(guild.roles, name="Houston Texans")
if Nor in user.roles and not HC or GM:
await user.add_roles(HC)
await ctx.send("Promoted to Head Coach!")
elif HC in user.roles:
await user.add_roles(GM)
await user.remove_roles(HC)
await ctx.send("Promoted to General Manager!")
elif GM in user.roles:
await ctx.send("Cannot go any higher than General Manager!")
``` Okay so im having an issue when i do ~promote @muted notch er it works and promotes them to Head Coach but if i do it again (~promote @muted notch er) it does the first if statement and not elif, can anyone tell me whats wrong?
!or
When checking if something is equal to one thing or another, you might think that this is possible:
if favorite_fruit == 'grapefruit' or 'lemon':
print("That's a weird favorite fruit to have.")
While this makes sense in English, it may not behave the way you would expect. In Python, you should have complete instructions on both sides of the logical operator.
So, if you want to check if something is equal to one thing or another, there are two common ways:
# Like this...
if favorite_fruit == 'grapefruit' or favorite_fruit == 'lemon':
print("That's a weird favorite fruit to have.")
# ...or like this.
if favorite_fruit in ('grapefruit', 'lemon'):
print("That's a weird favorite fruit to have.")
Same for and
mk thanks
Pretty sure you meant the first condition to do something else
@bot.command(help="Moderator/Admin Command")
async def kick(ctx, user: nextcord.User, *, reason=None):
guild = ctx.guild
myEmbed3 = nextcord.Embed(title='User Kicked Successfully!', description = f"**{user}** has been kicked")
myEmbed4 = nextcord.Embed(title=f'Kick Information for {user}', description = f"**{user.mention}** has been kicked by Admin/Moderator: **{ctx.author.mention}** because **{reason}**", timestamp = datetime.datetime.utcnow())
myEmbed4.set_footer(text=f'User ID: {user.id}')
myEmbed5 = nextcord.Embed(title=f'Your Kick from {guild}', description = f"You were kicked from {guild} because **{reason}**")
myEmbed5.set_footer(text=f'You were banned by Admin/Moderator: {ctx.author}')
myEmbed6 = nextcord.Embed(title='This User is a Admin/Moderator', color = nextcord.Color.red())
if user.guild_permissions.manage_messages:
await ctx.send(embed=myEmbed6)
return
else:
if ctx.author.guild_permissions.kick_members:
await ctx.send(embed=myEmbed3)
await guild.kick(user=user)
log_channel = bot.get_channel(875544805856407573)
await log_channel.send(embed=myEmbed4)
await user.send(embed=myEmbed5)```
What's wrong
did you read the error?
Typehint it with nextcord.Member, the User is a different thing
a User object isnt tied to a guild, so you cant access their guild_permissions
it doesn't exist
hm, my issue isnt the or. Its the elif statement on the second thing, if i do ~Promote user again it doesnt work and just says Promoted to Head Coach! and doesnt take/remove any roles
It is with or. So basically you have 3 tied conditions
(Nor in user.roles) and (not HC) or (GM)```
The third condition will always be `True` unless it is `None`
Afaik the "and" goes before "or"
Using VPS
i dont have one
Ik this is not a detailed answer lol
pick a hosting service
You need to purchase one
Although there are some free options
What if im broke 
@slate swan ^
Amazon aws offers 1 year free server
Do you guys generally have your bot automatically delete error messages after a few seconds?
doesnt seem to work still. Im not gonna ask for spoon feeds but if you could add any additional info it would help but thanks.
give bro
how could I make a dynamic menu with two buttons 'previous' and 'next' with callback, I would have to edit the webhook 10 times and it should go back and forth, how can I do this?
delete_after = secs

Yeah but do you do this with your bot?
Would users get annoyed
https://aws.amazon.com/ sign up here, create new EC2 instance with ubuntu, connect to it and do some setup https://gist.github.com/Exenifix/a8aa68a4976389757ff3121e6daadcf6
@bot.command(help="Moderator/Admin Command")
async def unban(ctx, user: nextcord.Member, *, reason=None):
guild = ctx.guild
myEmbed3 = nextcord.Embed(title='User Succesfully Unbanned', description = f"**{user}** has been unbanned!")
myEmbed4 = nextcord.Embed(title=f'Unban Information for {user}', description = f"**{user.mention}** has been unbanned by Admin/Moderator: **{ctx.author.mention}** because **{reason}**")
myEmbed4.set_footer(text=f'User ID: {user.id}')
myEmbed5 = nextcord.Embed(title=f'Your Unban from {guild}', description = f"You were unbanned from {guild} because **{reason}**", timestamp = datetime.datetime.utcnow())
myEmbed5.set_footer(text=f'You were unbanned by Admin/Moderator: {ctx.author}')
if ctx.author.guild_permissions.ban_members:
await ctx.send(embed=myEmbed3)
await guild.unban(user=user)
log_channel = bot.get_channel(879095317771997246)
await log_channel.send(embed=myEmbed4)
await user.send(embed=myEmbed5)
@unban.error
async def unban_error(ctx, error):
if isinstance(error, commands.MissingPermissions):
embed = nextcord.Embed(title='Missing Permissions', description = "You don't have the permissions! You need the `ban members` permissions", color = nextcord.Color.red())
await ctx.send(embed=embed)



😔