#discord-bots

1 messages · Page 457 of 1

slate swan
#

i don't understand😫

#

tyvm!

wispy sequoia
# slate swan tyvm!

example help command by my bot

@client.command()
async def help(ctx):
    helpEmbed = discord.Embed(title="Commands", color=0x000000)
    helpEmbed.add_field(
        name="#help", value="Shows this message.", inline=False)
    helpEmbed.add_field(
        name="#ping", value="Returns bot's latency.", inline=False)
    helpEmbed.add_field(
        name="#purge", value="Purges a certain amount of messages. Default is 5. Define the number of messages after `#purge` declaration.", inline=False)
    helpEmbed.add_field(
        name="#join (aliases: connect, come)", value="Makes the bot connect to a vocal channel.", inline=False)
    helpEmbed.add_field(
        name="#leave (aliases: disconnect, fuckoff)", value="Disconnects the bot from a voice channel.", inline=False)
    await ctx.reply(embed=helpEmbed, mention_author=False)```
wispy sequoia
#

np

#

if u need a footer

#

the footer is a small text under the embed

maiden fable
#

@wispy sequoia the help command is bad

#

!d discord.ext.commands.Bot.commands use this and loop through it

unkempt canyonBOT
slate swan
#

@wispy sequoia Let's not copy paste the code and spoonfeed, also this isn't the best way to make help command

maiden fable
#

Indeed

wispy sequoia
slate swan
maiden fable
wispy sequoia
#

I'm still learning

slate swan
#

That's why we told you about a better way to make one, if you'd like you can implement it

maiden fable
#

Well, I am just tell you... Just adviced u. Either loop through the bot.commands list of subclass helpcommand

#

!d discord.ext.commands.HelpCommand

unkempt canyonBOT
#

class discord.ext.commands.HelpCommand(**options)```
The base implementation for help command formatting.

Note

Internally instances of this class are deep copied every time the command itself is invoked to prevent a race condition mentioned in [GH-2123](https://github.com/Rapptz/discord.py/issues/2123).

This means that relying on the state of this class to be the same between command invocations would not work as expected.
maiden fable
#

U finding the tutorial by Stella?

#

Ah, thought so

wispy sequoia
spring flax
maiden fable
#

Aw haha

#

That's also a good tutorial

slate swan
#

Making api wrapper is pain blobpain

slate swan
#

There's almost 100 endpoints left notlikeblob

maiden fable
#

Only?

#

(@visual island is also making a wrapper)

wispy sequoia
#

is manage server manage_guild?

slate swan
#

Still need to improve requesting method and handle rate limits

maiden fable
#

Sad

slate swan
#

Not discord btw

maiden fable
wispy sequoia
#

ty

slate swan
#

Spotify API notlikeblob

maiden fable
#

I thought it was discord cat_headbang

steep estuary
#

help plz

maiden fable
#

!pypi Spotify

unkempt canyonBOT
maiden fable
#

.....

slate swan
#

Wait what fl_panik

maiden fable
heavy folio
#

okay so i have this and i wanna do <t:command_used_time:R> but its giving me this error:

maiden fable
steep estuary
#

it is not handling the exception everything is working but i want it should show the embed if someone will give wrong input or if someone will use command in wrong way

heavy folio
slate swan
#

Nvm I'll make one more

slate swan
#

not a datetime object

#

convert that to posix timestamp

heavy folio
#

then how do i make the ctx.message.created_at into an int

#

i want to use unix time <t:unix:D>

frigid badge
#

Hey can someone help me , my bot is doing executing commands twice due to these lines of code

async def initialise(): await client.wait_until_ready() client.db = await aiosqlite.connect("expData.db") await client.db.execute("CREATE TABLE IF NOT EXISTS guildData (guild_id int, user_id int , exp int, PRIMARY KEY (guild_id, user_id))")

can someone tell me whats wrong ?

i used sqlite3.

slate swan
#

!d datetime.datetime.timestamp

unkempt canyonBOT
#

datetime.timestamp()```
Return POSIX timestamp corresponding to the [`datetime`](https://docs.python.org/3.10/library/datetime.html#datetime.datetime "datetime.datetime") instance. The return value is a [`float`](https://docs.python.org/3.10/library/functions.html#float "float") similar to that returned by [`time.time()`](https://docs.python.org/3.10/library/time.html#time.time "time.time").

Naive [`datetime`](https://docs.python.org/3.10/library/datetime.html#datetime.datetime "datetime.datetime") instances are assumed to represent local time and this method relies on the platform C `mktime()` function to perform the conversion. Since [`datetime`](https://docs.python.org/3.10/library/datetime.html#datetime.datetime "datetime.datetime") supports wider range of values than `mktime()` on many platforms, this method may raise [`OverflowError`](https://docs.python.org/3.10/library/exceptions.html#OverflowError "OverflowError") for times far in the past or far in the future.

For aware [`datetime`](https://docs.python.org/3.10/library/datetime.html#datetime.datetime "datetime.datetime") instances, the return value is computed as:

```py
(dt - datetime(1970, 1, 1, tzinfo=timezone.utc)).total_seconds()
```   New in version 3.3.

Changed in version 3.6: The [`timestamp()`](https://docs.python.org/3.10/library/datetime.html#datetime.datetime.timestamp "datetime.datetime.timestamp") method uses the [`fold`](https://docs.python.org/3.10/library/datetime.html#datetime.datetime.fold "datetime.datetime.fold") attribute to disambiguate the times during a repeated interval.
heavy folio
#

ohh so i do ctx.message.created_at.timestamp()?

slate swan
heavy folio
#

okay ty

wispy sequoia
#
@client.command(aliases=["knockout", "yeet"])
@has_permissions(administrator=True, kick_members=True, manage_guild=True)
async def kick(ctx, member: discord.Member, *, reason=None):
    try:
        await member.kick(reason=reason)
        embed = discord.Embed(color=0x000000)
        embed.add_field(name="\u2705 Success!",
                        value=f"Successfully kicked `{member}` with reason `{reason}`.", inline=False)
        embed.set_footer(text=f"ID: {member.id}")
        await ctx.send(embed=embed)
    except:
        embed = discord.Embed(color=0x000000)
        embed.add_field(
            name="\u26d4 Error!", value="An error occurred.", inline=False)
        await ctx.send(embed=embed)```

This is the kick command, how to make a no-permessions member know why they can't run the command?
maiden fable
unkempt canyonBOT
#
Not in a million years.

No documentation found for the requested symbol.

maiden fable
#

Bruh

#

Anyways it's either MissingPermissions or CheckFaliure exception

wispy sequoia
#

lemme check console

steep estuary
wispy sequoia
#

put just except:

#

maybe it will handle all exceptions

#

it works fine for me

steep estuary
#

k

wispy sequoia
maiden fable
#

Yea

frigid badge
#

Can someone help me please.

maiden fable
#

With?

steep estuary
frigid badge
# maiden fable With?

Hey can someone help me , my bot is doing executing commands twice due to these lines of code

async def initialise(): await client.wait_until_ready() client.db = await aiosqlite.connect("expData.db") await client.db.execute("CREATE TABLE IF NOT EXISTS guildData (guild_id int, user_id int , exp int, PRIMARY KEY (guild_id, user_id))")

can someone tell me whats wrong ?

i used sqlite3.

wispy sequoia
maiden fable
#

Do u have an on_message?

steep estuary
frigid badge
maiden fable
#

Hi

maiden fable
frigid badge
maiden fable
#

Sadly, nope

steep estuary
maiden fable
frigid badge
frigid badge
# maiden fable Hmm, ok

`@client.event
async def on_message(message):
if not message.author.bot:
cursor = await client.db.execute("INSERT OR IGNORE INTO guildData (guild_id, user_id, exp) VALUES (?,?,?)",(message.guild.id, message.author.id, 1))

if cursor.rowcount == 0:
  await client.db.execute("UPDATE guildData SET exp=exp + 1 WHERE guild_id = ? AND user_id = ?", (message.guild.id, message.author.id))

  cur = await client.db.execute("SELECT exp FROM guildData WHERE guild_id = ? AND user_id = ?", (message.guild.id, message.author.id))

  data = await cur.fetchone()
  exp = data[0]
  lvl = math.sqrt(exp) / client.multiplier

  if lvl.is_integer():
    await message.channel.send(f"{message.author.mention} well done! You are now level: {int(lvl)}.")

await client.db.commit()

await client.process_commands(message)`

this is the on_message

river merlin
#

hello @tardy lagoon

slate swan
#

This isn't a place to advertise 👀

steep estuary
#

how i can except all exceptions ?

slate swan
#

except:

steep estuary
#

not working :/

slate swan
#

Code?

steep estuary
#

i tried everything

heavy folio
slate swan
#

MissingRequiredArgument is not raised inside the callback.

#

You need to make an error handler for this

steep estuary
#

?

heavy folio
slate swan
#

Dpy raises it itself while calling the callback

slate swan
#

Make it timezone aware

#

how can i give an error when the author has permission but their role is lower

heavy folio
heavy folio
slate swan
steep estuary
#

how i can make that ?

heavy folio
steep estuary
#

kk

heavy folio
slate swan
#

Also not sure what dpy gives as default

#

Maybe it calculates from your machine clock

heavy folio
#

yes

heavy folio
#

ctx.message.created_at.timestamp()

slate swan
#

Try aware = pytz.utc.localise(<datetime.datetime>)

heavy folio
#

but i want timestamp

slate swan
#

install pytz if you don't have

heavy folio
#

then where do i use the variable

#

oh okay

slate swan
#

it'll return aware object, now use .timestamp() on the return

#

One more way ```py
from datetime import timezone
dt = ctx.message.created_at # returns unaware datetime.datetime
dt = dt.replace(tzinfo=timezone.utc) # will update it with an aware object

lament yew
#

Guyz someone can help me?

#

like not actual help

#

I just want to know the code for a notification bot for twitch insta and youtube

slate swan
#

Search on top.gg and invite one rooThink

lament yew
#

it got almost everything just this bit is

#

uk difficlut

slate swan
#

Learn how to make one then. There are a lot of wrappers for those apis

lament yew
#

I dont know how to setup the apis

slate swan
#

You're already working with an API if you're making a discord bot notlikeblob

lament yew
#

am talking bout youtube and twitch api's

slate swan
#

!pypi python-youtube

unkempt canyonBOT
wispy sequoia
#
@client.command(aliases=["knockout", "yeet"])
@has_permissions(administrator=True, kick_members=True, manage_guild=True)
async def kick(ctx, member: discord.Member, *, reason=None):
    try:
        await member.kick(reason=reason)
        embed = discord.Embed(color=0x000000)
        embed.add_field(name="\u2705 Success!",
                        value=f"Successfully kicked `{member}` with reason `{reason}`.", inline=False)
        embed.set_footer(text=f"ID: {member.id}")
        await ctx.send(embed=embed)
    except:
        embed = discord.Embed(color=0x000000)
        embed.add_field(
            name="\u26d4 Error!", value="An error occurred.", inline=False)
        await ctx.send(embed=embed)```

I want to make an except: for missing permessions, I already tried some ways but it's not working. How do I make it?
wispy sequoia
#

!pypi youtube_dl

unkempt canyonBOT
slate swan
lament yew
slate swan
#

yert Then you should ask in djs

lament yew
#

ooo

#

thnx

maiden fable
#

Error handler

#

!d discord.on_command_error

unkempt canyonBOT
#

discord.on_command_error(ctx, error)```
An error handler that is called when an error is raised inside a command either through user input error, check failure, or an error in your own code.

A default one is provided ([`Bot.on_command_error()`](https://discordpy.readthedocs.io/en/stable/ext/commands/api.html#discord.ext.commands.Bot.on_command_error "discord.ext.commands.Bot.on_command_error")).
wispy sequoia
#

no no no

#

not a command error

#

a missing permession

#

like

#

Normal user: #kick user
Bot: You don't have enough permessions to do that

maiden fable
#

Whenever a check if failed, it's called a command error only...

wispy sequoia
#

but I want it to send a different embed for when a permession is missing

#

and also rn it's not sending anything if u miss a perm

#

this is when I try kick an admin/owner

#

but if u miss a perm it's not saying anything

maiden fable
#

Can I see the command error handler?

boreal ravine
#

it did what u wanted lol

wispy sequoia
boreal ravine
#
embed.add_field(name="Error!", value=f"{error}", inline=False)
``` maybe try this
wispy sequoia
#

nothing has been said

#

missing perms error raised in console

boreal ravine
wispy sequoia
#

yes

#

ofc

boreal ravine
#
@client.event
async def on_command_error(ctx, error):
  await ctx.send(error)
``` something like this
maiden fable
#

And use isinstance

boreal ravine
#

yes

maiden fable
#

!d isinstance

unkempt canyonBOT
#

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.10/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.10/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.10/library/exceptions.html#TypeError "TypeError") exception is raised.

Changed in version 3.10: *classinfo* can be a [Union Type](https://docs.python.org/3.10/library/stdtypes.html#types-union).
wispy sequoia
#
@client.event
async def on_command_error(ctx, error):
    if isinstance(error, MissingPermissions):
        await ctx.send(error)```
reef shell
#

commands.MissingPermissions

wispy sequoia
#

not needed as I've imported the MissingPermessions lib

reef shell
#

oh alr

steep estuary
#

i want help

boreal ravine
#

with wut

steep estuary
#

how i can take a number as decimal also

boreal ravine
steep estuary
#

this

#

i want to do float calculations also

#

:/

lament carbon
#

ok so my question is, is it possible to run multiple discord bot tokens on one project, if yes, can someone help me do it

#

please spam my dms or ping me 100 times if u can help me with this

steep estuary
#

first mine plz

lament carbon
#

ive seen someone do it before tho

#

thank tho

#

thanks*

boreal ravine
#

You wanna run 10 bots in a single file?

lament carbon
#

yes

#

no i want to run 2

reef shell
#

it's illeagal or againt ToS ig

lament carbon
#

what

#

why

boreal ravine
#

because automation

lament carbon
#

Ok but is it possible

steep estuary
#

how i can do float calculations toooooo

boreal ravine
#

uhhh sure ig if you find out a way

lament carbon
reef shell
boreal ravine
#

no i tried before but it didnt work as intended

lament carbon
#

oh ok

boreal ravine
crude prawn
#

my brain hurt

steep estuary
boreal ravine
#

what

steep estuary
#

:/

#

my command is like this >solve 1 * 1

#

when i am using float()

steep estuary
boreal ravine
#

yes

boreal ravine
steep estuary
#

i don't want this

boreal ravine
hasty iron
#

then dont do float()?

steep estuary
boreal ravine
reef shell
#

if float(num1) - int(num1) == 0:

hasty iron
#

then dont cast

#

do nothing

#

just the operation

willow vine
#

how to access bot as a user

#

or member

visual island
#

it violates discord's TOS

willow vine
#

wdym

#

no i don't mean self bot

boreal ravine
hasty iron
#

there is bot.user

visual island
#

oh i see

willow vine
#

but like if i want to check if the reaction is added bot then it should not perform the statements below

boreal ravine
#

o

willow vine
#

like

#
  pass```
visual island
#

there's some client out there that gives you access to login to a bot account, so i thought... sorry AG_Sad

willow vine
#

its fine

zinc lion
#

this doesnt wait for the on_ready event, thus the bot is aways offline```py
@bot.event
async def on_ready():
print('go')

async def something():
await bot.wait_until_ready()
channel = bot.get_channel(12345)
while True:
...

async def something2():
await bot.wait_until_ready()
channel = bot.get_channel(12345)
while True:
...

bot.loop.create_task(something())
bot.loop.create_task(something2()) ```

waxen granite
#
guild = str(ctx.guild.id)
        try:
            giveawayid = self.giveawaychan[guild]
        except KeyError:
            giveawayid = {}        
        messageid = await giveawaychannel.fetch_message(msg.id)
        giveawayid["messageid"] = messageid
        self.giveawaychan[guild] = giveawayid
        self.saveFile(self.giveawaychan, "giveaway.json")```
Error : `Command raised an exception: TypeError: keys must be str, int, float, bool or None, not Guild `
maiden fable
#

In which line u getting the error?

waxen granite
#

self.saveFile(self.giveawaychan, "giveaway.json")

#

File "D:\Discord Bot\ecrpgbot1-main\cogs\admin.py", line 222, in giveaway self.saveFile(self.giveawaychan, "giveaway.json") File "D:\Discord Bot\ecrpgbot1-main\cogs\admin.py", line 416, in saveFile json.dump(saveData, f, indent=4) File "C:\Users\Endomorph\AppData\Local\Programs\Python\Python39\lib\json\__init__.py", line 179, in dump for chunk in iterable: File "C:\Users\Endomorph\AppData\Local\Programs\Python\Python39\lib\json\encoder.py", line 431, in _iterencode yield from _iterencode_dict(o, _current_indent_level) File "C:\Users\Endomorph\AppData\Local\Programs\Python\Python39\lib\json\encoder.py", line 376, in _iterencode_dict raise TypeError(f'keys must be str, int, float, bool or None, ' TypeError: keys must be str, int, float, bool or None, not Guild

maiden fable
#

Print giveawayid

waxen granite
#

{ "824359600584523876": { "messageid":
now the json appears like this :3

waxen granite
maiden fable
#

Weird

#

So somewhere, u r saving discord.Guild object to the JSON

waxen granite
waxen granite
waxen granite
#

can't we save msg ids ina json?

slate swan
#

read it again

#

carefully

#

also if possible change the naming a bit, it's getting so confusing

waxen granite
#

not able to interpret :3

boreal ravine
#

hm

waxen granite
slate swan
#

Not for me fl_panik , it'll help you to interpret it easily

#

messageid = await giveawaychannel.fetch_message(msg.id)

#

you're saving message object in json not id

waxen granite
slate swan
#

You don't need this line if you already have id

waxen granite
#

hm

slate swan
#

4/5 messages edited blobpain

waxen granite
#

i am too fast typer for my own good :3

steep estuary
#

how to dm a user if he react on a msg :/

minor kestrel
#

@commands.has_role(ROLE ID)

#

or @commands.has_any_role(ROLES ID SEPARETED BY COMAS)

steep estuary
#

how to dm a user if he react on a msg :/

minor kestrel
#

Then you need an error handler

#

do you have one?

steep estuary
#

i want if someone will react on a msg then he will get dm from bot :/

slate swan
#

ctx.author

minor kestrel
#

then add a filter for this type of error commands.MissingPermissions

steep estuary
#

like if i want to do giveaway and the bot will give the code to user in dm if he will react

#

Please someone just tell how to let bot react if someone react on a msg

minor kestrel
#

pls calm

#

not always people is going to help you they have their own problems

#

you need to add a filter for the error I said before

#

and if the error is the same then add something like -> await ctx.send('Insufficient permissions')

#

not exactly that

#

do you know the isinstance mehtod? to check values?

wispy sequoia
#

is it possible to make a bot send normal text and an embed in the same message?

#

how

minor kestrel
#

then use it like this

if isinstance(error, commands.MissingPermissions):
  #here execute the code

or the other options similar to what you did

guild = bot.get_guild(GUILD ID)
AdminRole = guild.get_role(ROLE ID)

if commands.MissingRole(AdminRole):
  #Execute code here
wispy sequoia
#

lemme try

hoary gust
#

Guys is it possible to get the name of the cog by in which cmd is present?

#

@slate swan I want to get the name of a cog using a cmd

#

Like I want to know which cmd is in which cog

minor kestrel
#

@slate swan But I recommend you the first way because can be used for every error related to missing permisions, because in the other you need to specify a filter for each command

#

But use what you consider better solution to your problem

hoary gust
#

Any way or directory?

hoary gust
#

Thanks

wispy sequoia
#

you know the big image at the bottom of an embed

#

what is it

#

no

hoary gust
#

@minor kestrel how can I get that cog, in the docs its written it is optional but where the cog arg

wispy sequoia
#

helpEmbed.set_thumbnail(url="https://puzzenti.github.io/images/pfp.png")

hoary gust
#

I mean where to write the cog arg

slate swan
#

how to add custom emoji like a nitro emoji in my bot

minor kestrel
#

what you want is to get the cog where the command is isn't it?

#

then use command.Cog

#

wich returns the cog

minor kestrel
#

and is you want the name use the attributes of Cog

boreal ravine
waxen granite
#

how can i write this statement?
when x = y: do something

slate swan
boreal ravine
#

Then get the emoji markdown then paste it into a string or something

boreal ravine
slate swan
#

bot

waxen granite
slate swan
#

with a task

waxen granite
#

i dont know that, do you have some examples of it? how do i use it?

slate swan
#

that would check if x >= futuredate like every minute

boreal ravine
#

hm

waxen granite
#

u mean @tasks.loop?

slate swan
#

yeah

waxen granite
#

hm , but if there is no giveaway it would send errors

slate swan
#

wat

#

check if the variables exist

#

or when you have a giveaway, you start the task

#

once you've sent the message at the end, the task stops

waxen granite
#

hm

slate swan
#

wait

#

that doesn't stop the restart problem

#

does it

waxen granite
#

it doesnt

slate swan
#
@tasks.loop(seconds=60)
async def giveawaytask():
    if x and futuredate:
        if x >= futuredate:
            #get the message and send it
#

will you have multiple giveaways at once? 👀

waxen granite
#

i am getting the giveaway msg id from a json so it can be like if x is more than than of the message.created_at, then it should continue, else: do the task

slate swan
waxen granite
slate swan
#

per guild

#

oof

waxen granite
#

well that are multiple in a way i guess

slate swan
#

do you get the futuretime from a json too?

waxen granite
#

wont this task make alot api calls :3

waxen granite
#

or maybe i can

slate swan
#

ig

hasty iron
#

you cant store datetime objects inside json

#

store its timestamp instead

slate swan
#

strings tho

#

you can convert strings to datetime

hasty iron
#

timestamp is better

slate swan
#

prolly

#

get the futuretime, then if futuretime <= nowtime, get the message that was passed to the futuretime and continue

#

Tadanimated help i want to add this emoji in discord bot will it accept

#

isn't it like a database

#

Tadanimated this emoji

#
futuretime | message1
futuretime | message2
futuretime | message3
futuretime | message4
slate swan
#

isn't it built like this

#

aw man

#

if the bot is in that server, it can use the emoji like this

slate swan
#

then it can't use that emoji

#

bru

#

if you're not in a server, you can't use that server's emoji either

slate swan
#

but does the bot have nitro

#

yes

slate swan
slate swan
#

ofc

slate swan
#

if he has access to the emoji

#

bro u r best

waxen granite
#

how do i save time stamp?

slate swan
#

a \ before the emoji

slate swan
#

\:emoji:

#

ohk

slate swan
#

what

slate swan
boreal ravine
#

@slate swan bruh i already told u..

slate swan
minor kestrel
#

Hi i am having an issue, I am using the event on_member_remove and then get the audit logs and filter them for kick actions async for entry in guild.audit_logs(action=discord.AuditLogAction.kick): this is to know if a user have been kicked even if the moderators doesn't use the command of the bot and do it by using the simply the discord option to kick a member. But there are some members that have been kicked by the bot, but instead of not doing nothing (as it should do based on the code below) it blame the kick action on another random moderator. Why is this???

Code:

@commands.Cog.listener()
    async def on_member_remove(self, member):
        guild = self.bot.get_guild(GUILD ID)
        async for entry in guild.audit_logs(action=discord.AuditLogAction.kick):
            if entry.user.bot:
                return
                #It should stop here but instead it blame it on another moderator
            else:
              #Execute code and send a message saying who kicked the user
boreal ravine
slate swan
slate swan
#

see what

slate swan
#

oh

#

is the bot in the weeb server?

#

no

#

will not work

slate swan
minor kestrel
slate swan
slate swan
#

send that emoji here with the backslash before it

#

ok

#

\:emoji:

slate swan
minor kestrel
slate swan
slate swan
#

no

#

the string is built up like

#

<a:emoji_name:emoji_id:>

#

await message.add_reaction("Tadanimated716258118136234075")

#

yes

slate swan
#

await message.add_reaction(":Tadanimated:")

#

no

#

bru

slate swan
#

discord is just bullying me rn

#

mordex

#

is this some brawlhalla stuff? yert

slate swan
#

ok but you need to paste in that long version

#

not just the name of the emoji

slate swan
#

see all of this

#

NO

grim oar
#

!d discord.Message.add_reaction

unkempt canyonBOT
#

await add_reaction(emoji)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).

Add a reaction to the message.

The emoji may be a unicode emoji or a custom guild [`Emoji`](https://discordpy.readthedocs.io/en/stable/api.html#discord.Emoji "discord.Emoji").

You must have the [`read_message_history`](https://discordpy.readthedocs.io/en/stable/api.html#discord.Permissions.read_message_history "discord.Permissions.read_message_history") permission to use this. If nobody else has reacted to the message using this emoji, the [`add_reactions`](https://discordpy.readthedocs.io/en/stable/api.html#discord.Permissions.add_reactions "discord.Permissions.add_reactions") permission is required.
grim oar
#

It's ^

slate swan
grim oar
#

Not Context.add_reaction

slate swan
#

do we need the a

#

also what novia said

grim oar
#

If it's animated

slate swan
slate swan
boreal ravine
#

Normal Emoji: <:emoji_name:emoji_id>
Animated Emoji: <a:emoji_name:emoji_id>

slate swan
waxen granite
slate swan
#

i removed it i will add someday later

#

hm

boreal ravine
boreal ravine
slate swan
#

<a:emoji:emoji_id>

compact field
#

guys how can i get all messages of channel ?

slate swan
#

!d discord.TextChannel.history

unkempt canyonBOT
#

async for ... in history(*, limit=100, before=None, after=None, around=None, oldest_first=None)```
Returns an [`AsyncIterator`](https://discordpy.readthedocs.io/en/stable/api.html#discord.AsyncIterator "discord.AsyncIterator") that enables receiving the destination’s message history.

You must have [`read_message_history`](https://discordpy.readthedocs.io/en/stable/api.html#discord.Permissions.read_message_history "discord.Permissions.read_message_history") permissions to use this.

Examples

Usage...
slate swan
#

but what you said is sus

waxen granite
#

@slate swanhow do i save the time ?

slate swan
#

dunno

#

I don't know nothing about json, nor about timestamp

vestal badger
#

Hi, I'm using DC Webhooks to send message to channels in my server. I was wondering if there's any way to @mention under that message.
Is that possible?

slate swan
#

mention a member?

slate swan
vestal badger
slate swan
#

!d discord.Role.mention

unkempt canyonBOT
vestal badger
#

I'm not using dc bot but Webhooks

#

So, any way to mention a role with Webhooks?

waxen granite
#

what was the @tasks.loop version for cogs?

steep estuary
#

how can i let bot send msg at 8pm automatically?

#

anyone plz answer :/

hoary gust
# minor kestrel what?

Like I know the name of a command, now I want to get the name of the cog in which the command I got previously exists

slate swan
steep estuary
#

how can i let my discord bot send msg at 8pm automatically?

steep estuary
maiden fable
tulip pawn
#

how to make a command where it can take in 2 arguments seperated by a comma

steep estuary
maiden fable
#

Ah

#

Well, I ain't familiar with that type, but I think u will have to use the datetime module

steep estuary
#

ok like a command is >tellmehiat 6

#

so it should tell hi at 6 :/

remote cairn
#

Hello guys

#

I am new here

#

just joined

supple thorn
#

What is your purpose

steep estuary
#

me?

#

@slate swan can i use normal python functions in discord.py?

maiden fable
maiden fable
steep estuary
supple thorn
maiden fable
slate swan
steep estuary
#

like a command is >tellmehiat 6
so it should tell hi at 6 :/

#

i want to do this plz help

unique nexus
#
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: AttributeError: 'Guild' object has no attribute 'role'
[3:57 PM]
@commands.command()
    async def rvc(self,ctx,role: discord.Role=None,channel=None):
        channel=ctx.channel
        overwrites = ctx.channel.overwrites_for(role)
        
        
        if overwrites.send_messages==True:
            perm = channel.overwrites_for(role)
            perm.read_messages = True
            await ctx.send("lol")
#

how will i correct this

hasty iron
unkempt canyonBOT
#

datetime.timestamp()```
Return POSIX timestamp corresponding to the [`datetime`](https://docs.python.org/3.10/library/datetime.html#datetime.datetime "datetime.datetime") instance. The return value is a [`float`](https://docs.python.org/3.10/library/functions.html#float "float") similar to that returned by [`time.time()`](https://docs.python.org/3.10/library/time.html#time.time "time.time").

Naive [`datetime`](https://docs.python.org/3.10/library/datetime.html#datetime.datetime "datetime.datetime") instances are assumed to represent local time and this method relies on the platform C `mktime()` function to perform the conversion. Since [`datetime`](https://docs.python.org/3.10/library/datetime.html#datetime.datetime "datetime.datetime") supports wider range of values than `mktime()` on many platforms, this method may raise [`OverflowError`](https://docs.python.org/3.10/library/exceptions.html#OverflowError "OverflowError") for times far in the past or far in the future.

For aware [`datetime`](https://docs.python.org/3.10/library/datetime.html#datetime.datetime "datetime.datetime") instances, the return value is computed as:

```py
(dt - datetime(1970, 1, 1, tzinfo=timezone.utc)).total_seconds()
```   New in version 3.3.

Changed in version 3.6: The [`timestamp()`](https://docs.python.org/3.10/library/datetime.html#datetime.datetime.timestamp "datetime.datetime.timestamp") method uses the [`fold`](https://docs.python.org/3.10/library/datetime.html#datetime.datetime.fold "datetime.datetime.fold") attribute to disambiguate the times during a repeated interval.
hasty iron
#

!d datetime.datetime.fromtimestamp

unkempt canyonBOT
#

classmethod datetime.fromtimestamp(timestamp, tz=None)```
Return the local date and time corresponding to the POSIX timestamp, such as is returned by [`time.time()`](https://docs.python.org/3.10/library/time.html#time.time "time.time"). If optional argument *tz* is `None` or not specified, the timestamp is converted to the platform’s local date and time, and the returned [`datetime`](https://docs.python.org/3.10/library/datetime.html#datetime.datetime "datetime.datetime") object is naive.

If *tz* is not `None`, it must be an instance of a [`tzinfo`](https://docs.python.org/3.10/library/datetime.html#datetime.tzinfo "datetime.tzinfo") subclass, and the timestamp is converted to *tz*’s time zone.
boreal ravine
#

How do i edit a message thats a variable inside another command?

dense swallow
#
flags = discord.PublicUserFlags
        fl = member.public_flags
        fe = []

        f = {
            flags.bug_hunter: ':bug_hunter_lvl1:',
            flags.bug_hunter_level_2: ':bug_hunter_lvl2:',
            flags.staff: ':staff:',
            flags.early_supporter: ':support:',
            flags.early_verified_bot_developer: ':developer:',
            flags.partner: ':partnerbadge:',
            flags.hypesquad_balance: ':balance:',
            flags.hypesquad_bravery: ':bravery:',
            flags.hypesquad_brilliance: ':briliance:',
            flags.system: ':system:',
            flags.verified_bot: ':verified_bot:',
        }

        for x, y in f.items():
            if x in fl:
                fe.append(y)
``` why is this not returning user badges? anything wrong?
slate swan
#

flags is empty

chilly fossil
#

Hola

slate swan
#

Why do you even declare is

dense swallow
#

i want to get user's flags

slate swan
#

That's not how it works..

dense swallow
#

then?

lofty heron
#

hi, how can i remove the load and unload commands from the help menu? kek ik other people can't run this because i've made it owner only but i don't want people to try to use it

dense swallow
slate swan
#

Get the public user flags of the user, then use something like .bug_hunter on it and it gives a boolean back wether or not the user has this badge.

chilly fossil
#

Hey can anyone teach me python for discord.....i just know the basics

lofty heron
#

do just slap it on to the end of @client/commands.command() in the brackets?

dense swallow
pure reef
#

!docs

unkempt canyonBOT
slate swan
#

Yes

chilly fossil
#

ok

pure reef
#

hm

dense swallow
#

!refer

slate swan
dense swallow
#

ohh

slate swan
#

It returns a boolean

pure reef
#

still banned from dpy 😭

dense swallow
#

same

dense swallow
unique nexus
#

AttributeError: 'PermissionOverwrite' object has no attribute 'read_message'

#

it has attribute read_message?

slate swan
#

read_messages

unique nexus
#

i am confused

slate swan
#

!d discord.Permissions.read_messages

unkempt canyonBOT
unique nexus
#

oh ty i was wondering i saw in docs but why it is passing error

#

🥲

lofty heron
#

hi, i'm not sure what i did wrong with the client.eventon ready thing can somebody help?

stark bobcat
#

which database is best for economy command

steep estuary
#

i have a problem

#

this is not working without a error

hasty iron
#

closetime is not an event

tulip oracle
#

i cant seem to except discord.MemberNotFound? everytime my commands.MemberNotFound is called

steep estuary
#

:/

hasty iron
#

i mean exactly what i mean

#

closetime is not a valid event

steep estuary
#

i want to run the function without a command how i can run ?

hasty iron
#

run it like a normal function?

steep estuary
hasty iron
#

the use tasks

#

!d discord.ext.tasks.loop

unkempt canyonBOT
#

discord.ext.tasks.loop(*, seconds=0, minutes=0, hours=0, count=None, reconnect=True, loop=None)```
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/stable/ext/tasks/index.html#discord.ext.tasks.Loop "discord.ext.tasks.Loop").
steep estuary
#

how to use it :/

#

k

stark bobcat
#

which database is best for economy command

steep estuary
lofty heron
steep estuary
#

wht the given minutes will do ?

tulip oracle
#

dict base db's

hasty iron
steep estuary
#

but i want to run that in given time :/

boreal ravine
hasty iron
#

then run it whenever you want

steep estuary
#

only this much?

hasty iron
#

you want to check if a giveaway ended

dense swallow
#
        flags = member.public_flags
        if flags.bug_hunter:
            ':bug_hunter_lvl1:'
        if flags.bug_hunter_level_2:
            ':bug_hunter_lvl2:'
        if flags.staff:
            ':staff:'
        if flags.partner:
            ':partnerbadge:'
        if flags.verified_bot:
            ':verified_bot:'
        if flags.verified_bot_developer:
            ':developer:'
        if flags.system:
            ':system:'
        if flags.hypesquad_balance:
            ':balance:'
        if flags.hypesquad_brilliance:
            ':briliance:'
        if flags.hypesquad_bravery:
            ':bravery:'
        if flags.early_supporter:
            ':support:'

if flags:
            em.add_field(name="Discord Badges", value=' | '.join(), inline=False)

what should i put in .join() ?

hasty iron
#

you don't want to just check it once and thats it

unkempt canyonBOT
#

str.join(iterable)```
Return a string which is the concatenation of the strings in *iterable*. A [`TypeError`](https://docs.python.org/3.10/library/exceptions.html#TypeError "TypeError") will be raised if there are any non-string values in *iterable*, including [`bytes`](https://docs.python.org/3.10/library/stdtypes.html#bytes "bytes") objects. The separator between elements is the string providing this method.
tulip oracle
#

i cant seem to except discord.MemberNotFound? everytime my commands.MemberNotFound is called

steep estuary
#

like i start a giveaway by the command >gstart [channel where it will anounce] [time when bot will announce the winner]

steep estuary
dense swallow
tulip oracle
#

{flags.early_supporter:':support:'}

tulip oracle
#

then you have done it wrong

steep estuary
vagrant brook
tulip oracle
#

it is? i tried to except that before and it wouldnt

vagrant brook
tulip oracle
#

ill try it again

tulip pawn
#

how to make a command that can take 2 arguments seperated by a comma

vagrant brook
#

Just read everything

#

And use split()

#

!d str.split

unkempt canyonBOT
#

str.split(sep=None, maxsplit=- 1)```
Return a list of the words in the string, using *sep* as the delimiter string. If *maxsplit* is given, at most *maxsplit* splits are done (thus, the list will have at most `maxsplit+1` elements). If *maxsplit* is not specified or `-1`, then there is no limit on the number of splits (all possible splits are made).

If *sep* is given, consecutive delimiters are not grouped together and are deemed to delimit empty strings (for example, `'1,,2'.split(',')` returns `['1', '', '2']`). The *sep* argument may consist of multiple characters (for example, `'1<>2<>3'.split('<>')` returns `['1', '2', '3']`). Splitting an empty string with a specified separator returns `['']`.

For example:
tulip pawn
#

i did that but i didnt work

#

one sec ill send the code

dense swallow
vagrant brook
#

It's in dpy

velvet crest
#

Hwo can i do so that if i press one button both of them get disabled instead of one being disabled ? (Bot the buttons in that view )

vagrant brook
#

But bots don't have access to that endpoint

tulip pawn
# vagrant brook !d str.split
@bot.command
async def test(self, ctx, *, p):
    p1, p2 = p.split(",")
    await ctx.send(f"{p1} {p2}")
Ignoring exception in command None:
discord.ext.commands.errors.CommandNotFound: Command "test" is not found
hoary gust
#

how to use that cog

vagrant brook
hoary gust
#

how to get the name of the cog using that cog param

#

?

vagrant brook
#

Sorry for ping 😓

tulip pawn
#

thanks a lot

#

rookie mistake

vagrant brook
#

I think you need special OAuth scopes

dense swallow
#

its just getting badges..

#

right?

hoary gust
#

?

dense swallow
hoary gust
#

but how to use that param

#

?

dense swallow
#

cog.qualified_name

#

async def send_cog_help(self, cog):
title = cog.qualified_name

#

and then use in embed or send simply

hoary gust
#

i got it

#

maybe

slate swan
dense swallow
dense swallow
#

lol msg deleted ?

tulip pawn
#

yea i got it pichu cleared my doubt thanks though!

dense swallow
#

ok

hoary gust
#

@dense swallow is it correct

async def test(self, ctx, cog):
    await ctx.send(cog.qualified_name)
dense swallow
#

ctx?

#

in HelpCommand it is self.get_destination()

hoary gust
dense swallow
#

to send in HelpCommand its not ctx, its self.get_destination, you can define a var

#

channel = self.get_destination()
await channel.send()

grim mango
#

can somebody help me to create a mod mail bot??

#

plz??

hoary gust
steep estuary
#

please help me

dense swallow
#

just in general?

steep estuary
#

i have this command but it is not working

#

not atleast once

dapper cobalt
hoary gust
hoary gust
dapper cobalt
hoary gust
dapper cobalt
#

I can't help you too much since I'm on my phone. Try to search in the docs for the command object.

hoary gust
#

i wil use test2 and it will send me the name of the cog of test

jolly scroll
#

ERROR:

Ignoring exception in command _eval:
Traceback (most recent call last):
  File "main.py", line 1595, in _eval
    f"async def func():\n{textwrap.indent(code, '    ')}", local_variables,
  File "/usr/lib/python3.8/textwrap.py", line 480, in indent
    return ''.join(prefixed_lines())
  File "/usr/lib/python3.8/textwrap.py", line 478, in prefixed_lines
    for line in text.splitlines(True):
AttributeError: 'NoneType' object has no attribute 'splitlines'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/ext/commands/core.py", line 85, in wrapped
    ret = await coro(*args, **kwargs)
  File "main.py", line 1601, in _eval
    result = " ".join(format_exception(e, e, e.__traceback__))
NameError: name 'format_exception' is not defined

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/ext/commands/bot.py", line 939, in invoke
    await ctx.command.invoke(ctx)
  File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/ext/commands/core.py", line 863, in invoke
    await injected(*ctx.args, **ctx.kwargs)
  File "/opt/virtualenvs/python3/lib/python3.8/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: NameError: name 'format_exception' is not defined```

This is where the error is coming from:
```py
  try:
    with contextlib.redirect_stdout(stdout):
      exec(
          f"async def func():\n{textwrap.indent(code, '    ')}", local_variables,
      )

      obj = await local_variables["func"]()
      result = f"{stdout.getvalue()}\n-- {obj}\n"
  except Exception as e:
    result = " ".join(format_exception(e, e, e.__traceback__))```
dapper cobalt
#

Command object has a parent attribute which is the cog's class.

dense swallow
#

what??

dapper cobalt
dense swallow
#

@hoary gust ctx.command.cog.qualified_name returns the cog name of the command that is used

jolly scroll
dapper cobalt
jolly scroll
#

bruh

hoary gust
jolly scroll
dapper cobalt
dense swallow
#
# cogs/testcmd.py
@bot.command()
async def test(self, ctx):
  await ctx.send(f'This command belongs to cog: {ctx.command.cog.qualified_name}')
#

so this return testcmd

dense swallow
#

changed the cog name not to make it confusing

#

np

dapper cobalt
#

Doesn't it return the class's name and not the file?

dense swallow
#

yeah

#

you want the file name?

dapper cobalt
#

No. But I guess he thinks it returns the file's name.

dense swallow
#

to resolve that u can just name the file and class same name lol

hoary gust
dense swallow
#

idk that

#

but ik how to get class name of cmd

hoary gust
dense swallow
#

👍

#

@dapper cobaltcan u help me pls... im trying to get user's flags/badges

#
        flags = member.public_flags
        if flags.bug_hunter:
            ':bug_hunter_lvl1:'
        if flags.bug_hunter_level_2:
            ':bug_hunter_lvl2:'
        if flags.staff:
            ':staff:'
        if flags.partner:
            ':partnerbadge:'
        if flags.verified_bot:
            ':verified_bot:'
        if flags.verified_bot_developer:
            ':developer:'
        if flags.system:
            ':system:'
        if flags.hypesquad_balance:
            ':balance:'
        if flags.hypesquad_brilliance:
            ':briliance:'
        if flags.hypesquad_bravery:
            ':bravery:'
        if flags.early_supporter:
            ':support:'

        if flags:
            em.add_field(name="Discord Badges", value=' | '.join(), inline=False)

what should i put in .join() ?

hoary gust
#

@dense swallow can u tell me how to get a cogs name from a cmd that is not in it

dense swallow
#

is that possible ?

#

is this in HelpCommand?

hoary gust
hoary gust
minor kestrel
#

How could I make a temporal ban? any idea?

dense swallow
hoary gust
dense swallow
#

probably not efficient

visual island
#

use a db

#

then tasks.loop

pale turtle
#

I mean what cog name?

hoary gust
slate swan
#

!d discord.ext.commands.Command.cog_name

unkempt canyonBOT
pale turtle
#

Yeah you can't just magically get a Cog namr, how and what from yoh wabt to get it

slate swan
#

wdym?

hoary gust
pale turtle
#

Yeah so like what Akshu said

slate swan
#

!d discord.ext.commands.Bot.get_command

unkempt canyonBOT
#

get_command(name)```
Get a [`Command`](https://discordpy.readthedocs.io/en/stable/ext/commands/api.html#discord.ext.commands.Command "discord.ext.commands.Command") from the internal list of commands.

This could also be used as a way to get aliases.

The name could be fully qualified (e.g. `'foo bar'`) will get the subcommand `bar` of the group command `foo`. If a subcommand is not found then `None` is returned just as usual.
hoary gust
#

ok maybe i get it

dense swallow
waxen granite
#

how do i check if message is edited?

visual island
dense swallow
#

but then how do i make it into emojis?

hoary gust
#

@slate swan is it correct

cmd = self.bot.get_command("test")
cm2  = self.bot.cog_name(cmd)
print(cm2)
pale turtle
#

!d discord.ext.commands.Command.cog_name

unkempt canyonBOT
hoary gust
hasty iron
#

define "didnt work"

hoary gust
#

@hasty iron is it possible to unload a cog from a cog

hasty iron
#

yes?

slate swan
#

uh

hoary gust
#

ah

slate swan
#

!d discord.ext.commands.Bot.unload_extension

unkempt canyonBOT
#

unload_extension(name, *, package=None)```
Unloads an extension.

When the extension is unloaded, all commands, listeners, and cogs are removed from the bot and the module is un-imported.

The extension can provide an optional global function, `teardown`, to do miscellaneous clean-up if necessary. This function takes a single parameter, the `bot`, similar to `setup` from [`load_extension()`](https://discordpy.readthedocs.io/en/stable/ext/commands/api.html#discord.ext.commands.Bot.load_extension "discord.ext.commands.Bot.load_extension").
slate swan
#

^

hoary gust
#

?

slate swan
#

yes

#

if you have the bot attribute in the cog just do self.bot.unload_extension

dense swallow
#

Command raised an exception: HTTPException: 400 Bad Request (error code: 50035): Invalid Form Body
In embed.fields.4.value: This field is required

#

i have put in values in every embed

slate swan
#

Why doesn't this work? client.user.avatar_url

dense swallow
#

avatar_url

dense swallow
slate swan
#

no

steep estuary
#

what is this 😫

dense swallow
slate swan
slate swan
steep estuary
#

what is the problem

slate swan
#

nvm

dense swallow
steep estuary
#

srry :/

slate swan
slate swan
slate swan
slate swan
#

yes

#

it's avatar.url

#

oh

#

not _

#

okay

#

ty

dense swallow
#

new in v2?

slate swan
#

yeah

slate swan
dense swallow
#

damn

steep estuary
#

pls pls anyone?

slate swan
#
Traceback (most recent call last):
  File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/ext/commands/bot.py", line 994, in invoke
    await ctx.command.invoke(ctx)
  File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/ext/commands/core.py", line 894, in invoke
    await injected(*ctx.args, **ctx.kwargs)
  File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/ext/commands/core.py", line 176, in wrapped
    raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: AttributeError: 'NoneType' object has no attribute 'url'
slate swan
#

oh bruh?

#

read the error please.

slate swan
#

default profile picture = no profile picture

#

yeah

#

oh

#

which will raise nonetype error

dense swallow
#

lol

dense swallow
#

too much?

steep estuary
slate swan
slate swan
steep estuary
dense swallow
# slate swan send the embed
em = discord.Embed(color=discord.Color.blue(), timestamp=ctx.message.created_at)
        em.set_author(name = f"User-info of {member}")
        em.add_field(name='User ID', value=member.id, inline=False)
        em.add_field(name='Guild nickname', value=member.display_name, inline=False)
        em.add_field(name='Account creation', value=f"{format_date(member.created_at)}", inline=False)
        em.add_field(name='Date joined', value=f"{member.joined_at.strftime('%a, %#d %B %Y, %I:%M, %p UTC')}", inline=False)
        if fl:
            em.add_field(name="Discord Badges", value=' | '.join(fe), inline=False)
        else:
            em.add_field(name="Discord Badges", value=f'{self.bot.no} None', inline=False)
        em.add_field(name=f"Roles ({len(rolelist)})", value=f"{roles or 'N/A'}", inline=False)
        if member.bot:
            em.add_field(name='Member bot', value=f'{self.bot.yes} Yes', inline=False)
        else:
            em.add_field(name='Member bot', value=f'{self.bot.no} No', inline=False)
        em.set_footer(text=f"Requested by {ctx.author}", icon_url = ctx.author.avatar_url)
        em.set_thumbnail(url = member.avatar_url)
        await ctx.send(embed=em)
steep estuary
#

pls

slate swan
#

no

#

!ytdl

unkempt canyonBOT
#

Per Python Discord's Rule 5, we are unable to assist with questions related to youtube-dl, pytube, or other YouTube video downloaders as their usage violates YouTube's Terms of Service.

For reference, this usage is covered by the following clauses in YouTube's TOS, as of 2021-03-17:

The following restrictions apply to your use of the Service. You are not allowed to:

1. access, reproduce, download, distribute, transmit, broadcast, display, sell, license, alter, modify or otherwise use any part of the Service or any Content except: (a) as specifically permitted by the Service;  (b) with prior written permission from YouTube and, if applicable, the respective rights holders; or (c) as permitted by applicable law;

3. access the Service using any automated means (such as robots, botnets or scrapers) except: (a) in the case of public search engines, in accordance with YouTube’s robots.txt file; (b) with YouTube’s prior written permission; or (c) as permitted by applicable law;

9. use the Service to view or listen to Content other than for personal, non-commercial use (for example, you may not publicly screen videos or stream music from the Service)
slate swan
#

!rule 5 read it

unkempt canyonBOT
#

5. Do not provide or request help on projects that may break laws, breach terms of services, or are malicious or inappropriate.

hard merlin
#

sorry

dense swallow
#

tb?

slate swan
#

yes

#

traceback

dense swallow
#

i changed 4th em.add_field to this:

em.add_field(name='Date joined', value=f"{format_date(member.joined_at)}", inline=False)
slate swan
#

what happened then?

hard merlin
#

Also I have another question, how do I show the number of bots in a server??
I know that len(ctx.guild.members) will show the total members, but how to show only the number of bots in a server??

slate swan
dense swallow
slate swan
steep estuary
#

no one reply here i am asking from 2 hours 😦

dense swallow
slate swan
#

so the error is raised

dense swallow
#

gonna try that

slate swan
dense swallow
slate swan
dense swallow
#

yea

#

im using that format_date to see the user's account creation

#

but wont return date joined, or that 4 embed value

slate swan
#

who's account did you try on

dense swallow
#

mine

slate swan
#

well then i don't know sorry

#

something in the embed is empty

dense swallow
#

so that error is telling that the 4th em.add_field is empty?

slate swan
#

use []

#

instead of ()

#

also len([])

#

oh

#

yeah

hard merlin
#

now I get this

#

whoops, sorry I used [()] instead of ([])

brazen raft
#

Add parentheses around the list

#

Oh

pale turtle
#

I need bot ideas

hard merlin
#

now there is another problem, it shows this when there r actally two bots in the server

pale turtle
pale turtle
hard merlin
boreal ravine
pale turtle
#

Why is there if bot_user == bot.user

hard merlin
plucky shoal
#

You know that's against tos, right?

boreal ravine
#

^

hard merlin
#

I am sorry, but how is that related to a question on a bot count command?

boreal ravine
#

just saying lol

slate swan
plucky shoal
#

It's not related, it's just you can't stay in the server while using betterdiscord

pale turtle
#

You should do bot_user for bot_user in ctx.guild.members if bot_user.bot

slate swan
brazen raft
#

Or sum(map(lambda member: member.bot, ctx.guild.members))

dapper cobalt
boreal ravine
dapper cobalt
#

Well, Discord doesn't really care, so why would you?

hard merlin
boreal ravine
plucky shoal
dapper cobalt
#

He just used a theme which if you got mad over this you are just jealous imo.

plucky shoal
#

Deleting messages won't help, the server has logs of all messages

boreal ravine
boreal ravine
plucky shoal
boreal ravine
slate swan
#

Anyway, what he wants to do is up to him, so we should just leave it here

dapper cobalt
boreal ravine
plucky shoal
#

It is ^

boreal ravine
#

lmao

thick sigil
dapper cobalt
boreal ravine
#

github dark theme

plucky shoal
#

Light and dark themes are built in github already

dapper cobalt
#

Oh wait I think I got what you mean.

boreal ravine
#

yes

dapper cobalt
#

No I mean a Discord github dark theme.

#

A modified client.

plucky shoal
#

Any modification to the discord client is not allowed

#

Are you saying that you're using betterdiscord as well?

hard merlin
boreal ravine
dapper cobalt
#

Yes I am. But I'm not harming you or anyone in any way so I don't see a reason why you care so much tbh.

hard merlin
boreal ravine
reef shell
dapper cobalt
#

We gone too off-topic.

dapper cobalt
boreal ravine
#

😂

hard merlin
#

also they said it was illegal, its not illegal, its just against the tos. If its illegal then betterdiscord would have gotten a cease and decease order

boreal ravine
#

but I think I saw a chart where 5% of discord users got their account banned for client modifications

hard merlin
plucky shoal
#

<@&831776746206265384> This is just going off topic, talking about if betterdiscord is ok and stuff like that, stop it here please

boreal ravine
#

we stopped? (2 minutes ago)

plucky shoal
#

Not really

covert igloo
#

LOL

dapper cobalt
#

That was a pretty unnecessary ping tbh.

slate swan
pale turtle
#

I see no reason to actually ping the Mods. No one is currently asking for help, and there is a better option for now which is @novel apex . I reported a few minutes ago about the problem.

reef shell
slate swan
#

This is something ya'll brought up, so just stop it yourselves now

covert igloo
#

He gotta be trolling

boreal ravine
hot cobalt
#

It's fine, if the discussion is over then it's over, we can move on

pale turtle
reef shell
dapper cobalt
reef shell
#

nvm

pale turtle
#

.topic cough

lament depotBOT
#
**What's one feature you wish more developers had in their bots?**

Suggest more topics here!

hard merlin
dense swallow
boreal ravine
reef shell
#

alr imma paste the code it pastebin , then maybe you can see, otherwise @unkempt canyon is not letting me

dapper cobalt
#

Alright.

dense swallow
# slate swan wat?

member joined server line... i changed its position , now it says embed.value 2

#

before it was 4

reef shell
#

It's for a bot

slate swan
lament mesa
#

The docs say Member.joined_at can be None sometimes

steep estuary
#

why it is not changing the global StopTime ??

#

why it is not changing the global Stop Time?

dense swallow
steep estuary
#

oops srry

#

net problem

steep estuary
lament mesa
#

dont use globals

dense swallow
lament mesa
slate swan
dense swallow
#

ok it was some lag

#

same error

steep estuary
lament mesa
steep estuary
#

i just want to change that :/

steep estuary
#

?

lament mesa
steep estuary
#

aaaaaa wht is this i am seeing this first time :/

lament mesa
lament mesa
steep estuary
#

i should use it inside this function?

lament mesa
#

no

steep estuary
#

then?

#

here outside the command function?

#

??

lament mesa
#

wait

#

what are you trying to do?

steep estuary
#

the StopTime variable's value is not changing by using variable :/

#

my command takes >gstart [channel] [endtime]