#discord-bots

1 messages · Page 855 of 1

maiden fable
#

No

#

I mean, it will return a number between 0 and 1

#

Wait nvm

#

U will have to, uhhhh, use random.choice ig?

buoyant quail
#

with weights

leaden plaza
#

mhm

leaden plaza
buoyant quail
#

import random
print(random.choices(["win", "lose"], weights=[1, 99]))

green veldt
#

how to check if the bot is ratelimited

maiden fable
#

Turn on logging

green veldt
tardy wren
#

If I turn on intends, do I have to kick out the bot and re-invite it?

boreal ravine
#

no

quick gust
#

no

#

just restart your bot

tardy wren
#

I did but eh, I guess Ive messed something up

quick gust
#

!intents make sure you have both

unkempt canyonBOT
#

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.

quick gust
#

in your code, and enabled in dev portal

tardy wren
#

Yeah I did that

leaden plaza
#
@client.command()
async def raffle(ctx):
    win = discord.Embed(
        description='You Won!',
    )
    lose = discord.Embed(
        description='You lose!',
    )
    member = ctx.message.author
    role = get(member.guild.roles, name="Giveaway")
    random.choices([win, lose], weights=[1, 99])
    if lose:
        await ctx.send(embed=lose)
    elif win:
        await ctx.send(embed=win)
        await member.add_roles(role)
        await ctx.send(f"{member.mention} has been assigned the role: {role.name}")```
Can someone tell me what's wrong with if statement it keep sendin you won
#

Sorry if i did any dumb thing, I'm new to this

maiden fable
leaden plaza
maiden fable
#

Ig?

leaden plaza
#

i thought something is wrong with if statement

maiden fable
#

Qqi

leaden plaza
#

if lose:

maiden fable
#

Wait*

leaden plaza
#

is that fine?

green veldt
#

idk why is this happening 😥
i had made a bot with discord.py
today i added giveaway commands in it
but they dont work
but... when i comment out the other commands ( all of them leaving the giveaway one ) it works totally fine

maiden fable
#

U need to assign the randoms.choice to a variable

#

And need to see if that variable is lose or win

leaden plaza
#

lol = random.choices([win, lose], weights=[1, 99])

#

like this?

brisk zodiac
#

import discord
import os

client = discord.Client()

Picture = ["https://discord.com/channels/@me/946254767565439036/946310674101989397", "https://discord.com/channels/@me/946254767565439036/946310844155826186"

@client.event
async def on_ready():
print("We have logged in as {0.user}".format(client))

@client.event
async def on_message(message):
if message.author == client.user:
return

if message.content.startswith('.hug'):
    await message.channel.send((random choice)Picture)

client.run(os.getenv('TOKEN'))

Discord

Discord is the easiest way to communicate over voice, video, and text. Chat, hang out, and stay close with your friends and communities.

Discord

Discord is the easiest way to communicate over voice, video, and text. Chat, hang out, and stay close with your friends and communities.

maiden fable
#
if lol == win:
    . . . 
elif lol == lose
    . . . 
leaden plaza
#

if lol == win:
do this

brisk zodiac
#

what is the problem of this code

leaden plaza
green veldt
maiden fable
#

random.choice(Picture)

brisk zodiac
#

oh

#

but the error also said

#

File "main.py", line 10
async def on_ready():
^
SyntaxError: invalid syntax

maiden fable
#

U r missing a closing bracket

#

For the list, u r missing a ]

brisk zodiac
#

okay

green veldt
#

idk why is this happening 😥
i had made a bot with discord.py
today i added giveaway commands in it
but they dont work
but... when i comment out the other commands ( all of them leaving the giveaway one ) it works totally fine

#

HELP ME PLEASE

maiden fable
#

Can't help without any code buv

buoyant quail
#

code

green veldt
#

full code?

#

omg thats soooo long

buoyant quail
#

error?

brisk zodiac
#

client.run(os.getenv('TOKEN'))

green veldt
#

no error

brisk zodiac
#

it said File "main.py", line 21
client.run(os.getenv('TOKEN'))
^
SyntaxError: invalid syntax

green veldt
brisk zodiac
#

oh

buoyant quail
#

so we need code with command, that doesn't work

brisk zodiac
green veldt
maiden fable
brisk zodiac
#

lol

maiden fable
unkempt canyonBOT
#

Pasting large amounts of code

If your code is too long to fit in a codeblock in discord, you can paste your code here:
https://paste.pythondiscord.com/

After pasting your code, save it by clicking the floppy disk icon in the top right, or by typing ctrl + S. After doing that, the URL should change. Copy the URL and post it here so others can see it.

buoyant quail
green veldt
maiden fable
brisk zodiac
#

import discord
import os

client = discord.Client()

Picture = ["https://discord.com/channels/@me/946254767565439036/946310674101989397", "https://discord.com/channels/@me/946254767565439036/946310844155826186"]

@client.event
async def on_ready():
print("We have logged in as {0.user}".format(client))

@client.event
async def on_message(message):
if message.author == client.user:
return

if message.content.startswith('.hug'):
    await message.channel.send(random.choice(Picture)

client.run(os.getenv('TOKEN'))

Discord

Discord is the easiest way to communicate over voice, video, and text. Chat, hang out, and stay close with your friends and communities.

Discord

Discord is the easiest way to communicate over voice, video, and text. Chat, hang out, and stay close with your friends and communities.

#

error is File "main.py", line 21
client.run(os.getenv('TOKEN'))
^
SyntaxError: invalid syntax

buoyant quail
#

await message.channel.send(random.choice(Picture))

#

closing bracket )

maiden fable
#

Yea

leaden plaza
#
@client.command()
async def raffle(ctx):
    win = discord.Embed(
        description='You Won!',
    )
    lose = discord.Embed(
        description='You lose!',
    )
    lol = random.choices([win, lose], weights=[1, 99])
    member = ctx.message.author
    role = get(member.guild.roles, name="Giveaway")
    
    if lol == win:
        await ctx.send(embed=win)
        await member.add_roles(role)
        await ctx.send(f"{member.mention} has been assigned the role: {role.name}")
        
    elif lol == lose:
        await ctx.send(embed=lose)```
Now the bot isn't even responding, no error either
brisk zodiac
#

ohh

buoyant quail
leaden plaza
leaden plaza
maiden fable
maiden fable
green veldt
buoyant quail
#

[win, lose]

maiden fable
#

Oh wait... Missed that, sorry

leaden plaza
buoyant quail
#

if lol == [win]:

#

i think

maiden fable
#

Ah yes

leaden plaza
#

okok let me try

slate swan
#

!discord

maiden fable
#

Use choice, not choices

maiden fable
unkempt canyonBOT
#

In order to work with the library and the Discord API in general, we must first create a Discord Bot account.

Creating a Bot account is a pretty straightforward process.

buoyant quail
maiden fable
#

Idk I didn't tell him about the weights arg

#

!d random.choice

unkempt canyonBOT
#

random.choice(seq)```
Return a random element from the non-empty sequence *seq*. If *seq* is empty, raises [`IndexError`](https://docs.python.org/3/library/exceptions.html#IndexError "IndexError").
maiden fable
#

Nope it doesn't

brisk zodiac
#

My bot is online but it said this

#

Ignoring exception in on_message
Traceback (most recent call last):
File "/home/runner/Test/venv/lib/python3.8/site-packages/discord/client.py", line 343, in _run_event
await coro(*args, **kwargs)
File "main.py", line 19, in on_message
await message.channel.send(random.choice(Picture))
NameError: name 'random' is not defined

buoyant quail
#

import random

brisk zodiac
#

and it can not send message back

maiden fable
#

Yup

slate swan
#

if i created a code for a bot

#

where do i put the code

buoyant quail
#

in file

slate swan
#

oh ok

buoyant quail
#

xd

green veldt
brisk zodiac
#

Ignoring exception in on_message
Traceback (most recent call last):
File "/home/runner/Test/venv/lib/python3.8/site-packages/discord/client.py", line 343, in _run_event
await coro(*args, **kwargs)
File "main.py", line 19, in on_message
await message.channel.send(random.choice(Picture))
NameError: name 'random' is not defined

#

help me this error

buoyant quail
green veldt
#

Giveaway

buoyant quail
#

ok

leaden plaza
slate swan
#

Why i have this error?

command code:


@bot.command()   
async def say(message, *,args):
  await message.reply(args)
green veldt
#

message.reply() ...

slate swan
#

Thats works fine but idk i changed and the bot sends this error lol

brisk zodiac
#

Traceback (most recent call last):
File "/home/runner/Test/venv/lib/python3.8/site-packages/discord/client.py", line 343, in _run_event
await coro(*args, **kwargs)
File "main.py", line 19, in on_message
await message.channel.send(random.choice(Picture))
NameError: name 'random' is not defined

#

help me pls

slate swan
#

NameError: name 'random' is not defined

brisk zodiac
#

where?

leaden plaza
#

on the top

#

top

brisk zodiac
#

okay

#

tysm! it's work

green veldt
#

You must import the modules before using

slate swan
#

pd: message.reply() works fine but idk why i get this error

leaden plaza
buoyant quail
#

by me it workes

green veldt
slate swan
# slate swan any can help me?

the first argument in commands is always a Context object
And your error means that you use the say command without providing any arguments

buoyant quail
slate swan
green veldt
buoyant quail
#

no

green veldt
#

Paste

#

Then see

slate swan
#

well, good night

green veldt
#

K GN

slate swan
slate swan
#

Or just change .event to .listen()

green veldt
green veldt
slate swan
#

but?...

green veldt
#

That's .command()

slate swan
#

Commands and events are different thing

green veldt
#

Um

#

Where do i put

slate swan
#

The decorator above your on_message function...

#

change it to client.listen()

slate swan
# slate swan What error

i am benginer in Python

i create bots in node js, you know how i can create an:

if(!variable) return;
#

in py?

buoyant quail
#

if not variable: return

slate swan
#

oh god thanks❤❤

#

you can add the ; too if you want it to be fancy lol

buoyant quail
#

and brackets

slate swan
#

jiji tnks

#

idk why not work 😂😂

buoyant quail
#

cause message is ctx

green veldt
buoyant quail
#

try message.message.reply

unique lichen
#

is it possible to make a python code like user sends a image of dog , and i want to identify and compare it with the images i have of dog breeds

honest shoal
unique lichen
unique lichen
slate swan
#

i not use ctx before and works

honest shoal
honest shoal
slate swan
#

now idk what i change and the bot give that error lol 😂😂

unique lichen
slate swan
honest shoal
#

and you want breed so deep learning

unique lichen
#

ohh

slate swan
#

😂😂

unique lichen
#

Well to be more precise it was pokemon related too lol

unique lichen
slate swan
#

No

#

is bot normal

unique lichen
#

self. ?

buoyant quail
slate swan
#

Bot normal

unique lichen
#

well i think message is replaced by ctx

honest shoal
#

command.Context can be any

unique lichen
#

mhmm maybe not expert

#

but this snippet works

async def print(ctx, arg):
    await ctx.channel.send(arg)```
slate swan
#

small L tho

green veldt
#

it worked thanks!!!!

green veldt
#

anyways thanks bye

slate swan
#

Or do you want to compare it with local ones?

steel void
#

hey guys!

how do i make py (6, user_balance) the minimum 6 dollars and max 40% of user_balance?

buoyant quail
#

what?

steel void
#

bad way to explain it but basically

#

So right now I got it where you can steal between 6 dollars and their entire balance, but I want to make it where they can only steal up to 40% of user balance

buoyant quail
#

random.randint(6, int(user_balance * 0.4))

steel void
#

thank you math isnt my strong suite

slate swan
#

guys where do i put the fle of the code

#

file*

steel void
#
{:.2f}
``` how can I make this minutes with seconds, instead of just seconds?
maiden fable
#

To use mobile presence on your bot, just add this code to the main.py file of your bot and it will work:

async def mobile(self):
    import sys
    payload = {'op': self.IDENTIFY,'d': {'token': self.token,'properties': {'$os': sys.platform,'$browser': 'Discord iOS','$device': 'discord.py','$referrer': '','$referring_domain': ''},'compress': True,'large_threshold': 250,'v': 3}}
    if self.shard_id is not None and self.shard_count is not None:
        payload['d']['shard'] = [self.shard_id, self.shard_count]
    state = self._connection
    if state._activity is not None or state._status is not None: 
        payload["d"]["presence"] = {"status": state._status, "game": state._activity, "since": 0, "afk": False}
    if state._intents is not None:
        payload["d"]["intents"] = state._intents.value
    await self.call_hooks("before_identify", self.shard_id, initial=self._initial_identify)
    await self.send_as_json(payload)
discord.gateway.DiscordWebSocket.identify = mobile 

(Courtesy of discord.py server)

#

(Just saying)

slate swan
#

!discord

#

!d discord

unkempt canyonBOT
#

In order to work with the library and the Discord API in general, we must first create a Discord Bot account.

Creating a Bot account is a pretty straightforward process.

maiden fable
#

Eevee, are you still lurking here? 👀

maiden fable
#

Do u seriously have a self bot on?!

upbeat otter
#

Lmao

maiden fable
#

Which tells u everytime your name is said in a message smh

upbeat otter
maiden fable
#

To see whenever someone thinks/talks about u 👀

buoyant quail
#

lol

upbeat otter
#

Nor am I so free to do so

maiden fable
#

Lmao who knows. I mean u do lurk here everytime someone's talking about you. Coincidence? Idts

upbeat otter
maiden fable
#

Hmmmmm cool

upbeat otter
#

!ot anyways

unkempt canyonBOT
upbeat otter
#

I'll take my leave now

maiden fable
#

Lmao

#

sends yr name again after 15 min

upbeat otter
maiden fable
#

Bet

upbeat otter
#

Bet

slate swan
#

someone's having their last goodbyes

maiden fable
#

No thanks

slate swan
#

huh?

upbeat otter
#

Lmao

maiden fable
slate swan
maiden fable
#

I hate it anyways ot

slate swan
maiden fable
#

No thanks

#

I can bet that's yr bot 👀

slate swan
#

I have a lot of ewwy commands ngl

#

okay not many

slate swan
#

xD

#

70 commands dont come from here and there

maiden fable
slate swan
#

I'll ask okimii to add it to the Akeno server

maiden fable
#

They come in the category of shitty commands for me, thanks

slate swan
maiden fable
#

Meh

slate swan
#

i should be sleeping instead of coding oh well

maiden fable
buoyant quail
#

2 morning?

maiden fable
#

2 in the morning -> 2 AM

buoyant quail
#

it's night :

slate swan
#

btw

maiden fable
slate swan
#

can slash command names have spaces in between?

maiden fable
#

Nope

buoyant quail
#

i think no

maiden fable
#

U have to use slash command group

#

Or whatever it's called

slate swan
#

uhhh

maiden fable
#

Subcommands*

slate swan
#

added punch and kiss

#

gonna do like everything..

maiden fable
#

S. M. H.

#

The. Most. Cringe. Commands. Ever.

slate swan
#

i know right.

#

im happy about the bot though1 got it to play music

cosmic agate
#

File "main.py", line 82
message = await ctx.send(embed=embed)
^
IndentationError: unexpected unindent

slate swan
#

def didnt take 3/4 hours Smile

maiden fable
#

U r most probably indented with an extra space in that line

cosmic agate
#

so if message already exists, will it come?

slate swan
#

added kiss, slap, cuddle and punch

#

i think thats enough

cosmic agate
#

?

cosmic agate
maiden fable
cosmic agate
#

lol

cosmic agate
slate swan
#

had to be done aniblobsweat

cosmic agate
#

pls

slate swan
cosmic agate
#

link

#

line 82

buoyant quail
#

learn python first ..

cosmic agate
#

ik but

slate swan
#

uh

maiden fable
#

From line 27

slate swan
#

oh jeez

buoyant quail
#

if you know python you can't get indent error

maiden fable
#

Your indentation lol

cosmic agate
#

this my arch nemesis

cosmic agate
cosmic agate
quick gust
#

indent everything line 27 onwards

#

properly

cosmic agate
#

?

quick gust
#

how do u not understand

cosmic agate
#

like remove ALL THe SPACES?

quick gust
#

...

#

thats called un indenting

buoyant quail
#

2 tabs in lines 27-33

slate swan
cosmic agate
#

ok

#

so

#

how to know if i am doing it right

#

?

quick gust
#

use an IDE

#

it will show indentation errors

cosmic agate
#

i use replit

quick gust
#

or use vscode if u want the text editor feel

quick gust
cosmic agate
#

XD

#

i tabed line 82 and this is what i get

#

File "main.py", line 80
message = await ctx.send(embed=embed)
^
IndentationError: unindent does not match any outer indentation level

slate swan
buoyant quail
#

pycharm is best

cosmic agate
#

ok but ill have to install

slate swan
#

havent tried it

cosmic agate
#

anyways

#

pls help

#

anyone?

#

my new problem
File "main.py", line 80
message = await ctx.send(embed=embed)
^
IndentationError: unindent does not match any outer indentation level

quick gust
#

send code?

#

!paste

unkempt canyonBOT
#

Pasting large amounts of code

If your code is too long to fit in a codeblock in discord, you can paste your code here:
https://paste.pythondiscord.com/

After pasting your code, save it by clicking the floppy disk icon in the top right, or by typing ctrl + S. After doing that, the URL should change. Copy the URL and post it here so others can see it.

cosmic agate
#

ok

quick gust
#

..

#

press TAB

cosmic agate
#

where?

quick gust
#

the third button from the top left

buoyant quail
#

lol

cosmic agate
#

where?

#

in the website

#

or replt

quick gust
#

of course bruh

cosmic agate
#

ok

quick gust
#

in your code

#

where else do you think

cosmic agate
#

just text?

quick gust
#

in minecraft?

cosmic agate
quick gust
#

highlight lines 46-50, then press tab twice. first remove the spaces from
message = await ctx.send(embed=embed)

cosmic agate
#

there is no button in top left

quick gust
#

bro

#

on your keyboard

cosmic agate
#

xd

#

i feel like an idiot

#

lol

quick gust
#

makes sense

#

!resources to stop feeling like an idiot

unkempt canyonBOT
#
Resources

The Resources page on our website contains a list of hand-selected learning resources that we regularly recommend to both beginners and experts.

cosmic agate
#

so i have to go to replit highlight lines 47 to 50 and click tab, right?

slate swan
#

@cosmic agate you should check out the docs and youtube some stuff about python so you learn basics like indenting and where to find things on your keyboard!

slate swan
cosmic agate
#

File "main.py", line 80
message = await ctx.send(embed=embed)
^
IndentationError: unindent does not match any outer indentation level

#

lol bruh

buoyant quail
#

oh god...

quick gust
#

Ok yes I'm done

#

have fun

cosmic agate
#

ok

cosmic agate
#

ikr

#

here my code

slate swan
#

did you make this code?

quick gust
#

clearly not

cosmic agate
cosmic agate
buoyant quail
#

31 line need indentation too

cosmic agate
quick gust
slate swan
#

im going to bed fuck this

cosmic agate
#

XD

quick gust
#

!indents

unkempt canyonBOT
#

Indentation

Indentation is leading whitespace (spaces and tabs) at the beginning of a line of code. In the case of Python, they are used to determine the grouping of statements.

Spaces should be preferred over tabs. To be clear, this is in reference to the character itself, not the keys on a keyboard. Your editor/IDE should be configured to insert spaces when the TAB key is pressed. The amount of spaces should be a multiple of 4, except optionally in the case of continuation lines.

Example

def foo():
    bar = 'baz'  # indented one level
    if bar == 'baz':
        print('ham')  # indented two levels
    return bar  # indented one level

The first line is not indented. The next two lines are indented to be inside of the function definition. They will only run when the function is called. The fourth line is indented to be inside the if statement, and will only run if the if statement evaluates to True. The fifth and last line is like the 2nd and 3rd and will always run when the function is called. It effectively closes the if statement above as no more lines can be inside the if statement below that line.

Indentation is used after:
1. Compound statements (eg. if, while, for, try, with, def, class, and their counterparts)
2. Continuation lines

More Info
1. Indentation style guide
2. Tabs or Spaces?
3. Official docs on indentation

scarlet rune
#

what's that new timestamp thingy? R> something

cosmic agate
#

?

quick gust
#

here I guess?

scarlet rune
#

ah yeah that one, thanks

maiden fable
unkempt canyonBOT
#

discord.utils.format_dt(dt, /, style=None)```
A helper function to format a [`datetime.datetime`](https://docs.python.org/3/library/datetime.html#datetime.datetime "(in Python v3.9)") for presentation within Discord.

This allows for a locale-independent way of presenting data using Discord specific Markdown...
scarlet rune
#

okai

slate swan
#

!resources

unkempt canyonBOT
#
Resources

The Resources page on our website contains a list of hand-selected learning resources that we regularly recommend to both beginners and experts.

slate swan
#

Jk

maiden fable
#

Bro

slate swan
#

How to make commands locked to certain user ids

maiden fable
#

!d discord.ext.commands.check

unkempt canyonBOT
#

@discord.ext.commands.check(predicate)```
A decorator that adds a check to the [`Command`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.Command "discord.ext.commands.Command") or its subclasses. These checks could be accessed via [`Command.checks`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.Command.checks "discord.ext.commands.Command.checks").

These checks should be predicates that take in a single parameter taking a [`Context`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.Context "discord.ext.commands.Context"). If the check returns a `False`-like value then during invocation a [`CheckFailure`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.CheckFailure "discord.ext.commands.CheckFailure") exception is raised and sent to the [`on_command_error()`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.discord.ext.commands.on_command_error "discord.discord.ext.commands.on_command_error") event.

If an exception should be thrown in the predicate then it should be a subclass of [`CommandError`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.CommandError "discord.ext.commands.CommandError"). Any exception not subclassed from it will be propagated while those subclassed will be sent to [`on_command_error()`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.discord.ext.commands.on_command_error "discord.discord.ext.commands.on_command_error").
slate swan
#

Is it just for permissions I thought

maiden fable
#

It can be used to make custom checks

slate swan
maiden fable
#

u gotta use open

halcyon bison
#

does

slate swan
#

how/can I have groups for slash commands (using nextcord)

maiden fable
#

Yes, look into subcommands

slate swan
#

any docs or such?

maiden fable
#

Idrk sorry

slate swan
#

I tried commands.group like a regular command, it no work :(

slate swan
#

splendid, thanks

#

basically ```py
@slash_command(....)
async def cmd(...
...

@cmd.subcommand(...)
async def subcmd(..
...```

#

cool

#

how to make this

#

?

#

!d discord.Interaction

unkempt canyonBOT
#

class discord.Interaction```
Represents a Discord interaction.

An interaction happens when a user does an action that needs to be notified. Current examples are slash commands and components.

New in version 2.0.
visual island
#

await interaction.response.send_message(..., ephemeral=True)

autumn trench
#

I have a command with a while loop waiting for an input to a dropdown menu. It works exactly as expected, but it keeps responding on that message even after several hours have passed. I want to allow it to timeout if a certain amount of time has passed, but it only does anything in the loop if the message is interacted with. How would I fix this?

while True:
    inter = await message.wait_for_dropdown()
    if inter.author.id==ctx.author.id:
        label = inter.select_menu.selected_options[0].label
        for idx,_ in enumerate(_pageData):
            if _pageData[idx]['DIRECTORY'] == label:
                _newDir,index = _pageData[idx]['DIRECTORY'],idx
    
        embed = discord.Embed(title=_pageData[index]['TITLE'])
        embed.set_footer(text=directory)
        if 'IMAGE' in _pageData[index]:
            embed.set_thumbnail(url=_pageData[index]['IMAGE'])
        for i in _pageData[index]['SECTIONS']:
            print(i)
            embed.add_field(name=i['NAME'], value=i['TEXT'].replace('<COMMA>',','), inline=i['INLINE'])
    
        await message.edit(embed=embed,components=[SelectMenu(placeholder=_newDir,options=listOptions)])
austere solstice
#

pyTraceback (most recent call last): File "C:\Users\user\Desktop\Blossom Bot\main.py", line 2, in <module> from discord.ext import commands File "C:\Python37-32\lib\site-packages\discord\ext\commands\__init__.py", line 13, in <module> from .bot import Bot, AutoShardedBot, when_mentioned, when_mentioned_or File "C:\Python37-32\lib\site-packages\discord\ext\commands\bot.py", line 37, in <module> from .core import GroupMixin File "C:\Python37-32\lib\site-packages\discord\ext\commands\core.py", line 1127 for alias in command.aliases: ^ IndentationError: unexpected indent [Finished in 1.9s with exit code 1] [shell_cmd: python -u "C:\Users\user\Desktop\Blossom Bot\main.py"] [dir: C:\Users\user\Desktop\Blossom Bot] [path: C:\Python37-32\Scripts\;C:\Python37-32\;C:\Program Files\Common Files\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\GtkSharp\2.12\bin;C:\Program Files\Microsoft VS Code\bin;]

#

why isent it working?

autumn trench
austere solstice
autumn trench
#

make it so that that line is aligned on the left with the line above it

quasi stag
#

where do i use bot.wait_until_ready?

austere solstice
#

@autumn trench

autumn trench
supple crescent
autumn trench
#

it's really easy to undo iphone scribbles

supple crescent
#

nah jk

vocal snow
supple crescent
autumn trench
#

still shrug

#

ohh that looks like a problem with the package itself actually now

supple crescent
#

i want to make it so if sombody says !record it would copy that person next message and send it back. is that possible?

buoyant quail
#

add person to list add in on_message check if person in list: send

supple crescent
dense swallow
#

to check is something is above for example 5 characters, is it len(thing) >= 5 or just thing >= 5

boreal ravine
dense swallow
#

no need len?

boreal ravine
#

>= checks if the obj is equal to or bigger than the obj

dense swallow
#

yeah

boreal ravine
austere solstice
buoyant quail
boreal ravine
slate swan
#

just use vsc

slate swan
austere solstice
#

@slate swan

#

tried reinstalling

heavy hound
#

use vsc

austere solstice
heavy hound
#

through the cmd or ?\

austere solstice
austere solstice
heavy hound
austere solstice
heavy hound
#

😱

austere solstice
austere solstice
heavy hound
wanton cipher
brisk zodiac
#

How can i fix this

heavy hound
brisk zodiac
#

I don't have 😦

heavy hound
#

ok then

rotund cipher
#

Does someone know what happened here? The loop runs for a long time and all of a sudden I get this

brisk zodiac
heavy hound
#

i cant spoonfeed you like a mother

rotund cipher
#

I just use json.loads(response.text) for the api

rotund cipher
#

Cant copy from phone. 1 sec

wanton cipher
heavy hound
unkempt canyonBOT
#

When using JSON, you might run into the following error:

JSONDecodeError: Expecting value: line 1 column 1 (char 0)

This error could have appeared because you just created the JSON file and there is nothing in it at the moment.

Whilst having empty data is no problem, the file itself may never be completely empty.

You most likely wanted to structure your JSON as a dictionary. To do this, edit your empty JSON file so that it instead contains {}.

Different data types are also supported. If you wish to read more on these, please refer to this article.

rotund cipher
#

I do lol

heavy hound
#

your hand will be pain after a few coding

rotund cipher
#

Just saw the error from the phone

heavy hound
#

nope im bad on api and json stuff

rotund cipher
#

ok

boreal ravine
rotund cipher
#

was the api empty then?

sage otter
maiden fable
#

Ikrrrr

unreal spoke
#

How to call bot on

sage otter
#

I was just joking kayle. Because they don’t exist.

#

VSC isn’t an ide

#

It’s a text editor.

unreal spoke
#

How to make commands

vocal snow
pliant gulch
#

🙌 nvim

slim ibex
#

🗿

unreal spoke
pliant gulch
#

Emacs ❌

sage otter
#

Text editor isn’t really a what’s better. It’s a what suits your needs and what’s more comfortable to you as a developer.

pliant gulch
#

VSC can be an IDE or can be a regular text editor

#

That's the power that comes with extensions

#

Same with sublime, etc

#

Same with neovim, emacs etc

sage otter
#

I beg to differ.

supple crescent
#

Idk why this happens, I leave my computer alone and the bot breaks. Only like half the commands work and idk why. I have not edited the code

pliant gulch
# sage otter I beg to differ.

How so? Does the built-in source control, or the built-in debugger stop VSC from being any less than an IDE? What about the linters, the type checkers? What about all the other things you could have on VSC?

#

What about the terminal? Does the built-in terminal make VSC stop before anything close to an IDE?

sage otter
#

we can argue about it in #editors-ides in a sec Andy. I’m not willing to get slapped by a mod over a text editor/ide debate

pliant gulch
#

Sure

sage otter
sage otter
#

Is it really half or is it all of them.

supple crescent
#

Most

#

Like 1/3

sage otter
#

Never seen that before.

supple crescent
#

And !help just defaults

#

I want to try smthing

austere solstice
left crater
#

its free

#

replit is terrible

austere solstice
hoary cargo
scarlet rune
#

h

hoary cargo
sage otter
#

Why do people feel the need to shill their favorite text editor and ide in here after seeing someone’s screen shotted code.

hoary cargo
#

yeah mb

#

kek

#

pycharm is the supporting one

sage otter
#

I mean the newbie friendly part

#

Pycharm definitely isn’t newbie friendly

hoary cargo
#

i find pycharm very easy to use

#

maybe because i use it for almost 2 years

sage otter
#

It’s an online ide

#

As long as he’s not trying to host his bot with it

#

It’s fine. He can write code where he wants

brisk zodiac
left crater
hoary cargo
#

MR_uncanny_10 ^

sage otter
verbal agate
#

I need help with getting my discord bot to do something once a day

#

I want it to check the price of something

#

then send a message to the server if the price has dropped

slate swan
slate swan
slate swan
#

its not good

#

reptile is the worst editor

#

replit*

sage otter
#

damm

slate swan
#

lmao

sage otter
#

You really called him the worst editor

slim ibex
#

reptile

slate swan
#

lmao

sage otter
#

Why you gotta be such a bully Ashley

vast gale
#

yeah ashley

#

smh

slate swan
#

😭 what'd I do

vast gale
#

remember how i asked if you slept?

#

I didn't :^)

hazy oxide
#

!d discord.Guild.unban

unkempt canyonBOT
#

await unban(user, *, reason=None)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).

Unbans a user from the guild.

The user must meet the [`abc.Snowflake`](https://discordpy.readthedocs.io/en/master/api.html#discord.abc.Snowflake "discord.abc.Snowflake") abc.

You must have the [`ban_members`](https://discordpy.readthedocs.io/en/master/api.html#discord.Permissions.ban_members "discord.Permissions.ban_members") permission to do this.
slate swan
#

I know uh

#

dont be such a reptile

slate swan
brisk zodiac
#

is this right?

slate swan
#

wha.....

hazy oxide
#

ow ok

slate swan
#

ghost ping 🥲

vast gale
slate swan
brisk zodiac
#

@client.event
async def on_ready():
print("We have logged in as {0.user}".format(client))

@client.event
async def on_message(message):
if message.author == client.user:
return

if message.content.startswith('.hug'):
  await message.channel.send(random.choice(Picture)

if message.content.startswith('.kill'):
  await message.channel.send(random.choice(Picture2)
slate swan
#

!code

unkempt canyonBOT
#

Here's how to format Python code on Discord:

```py
print('Hello world!')
```

These are backticks, not quotes. Check this out if you can't find the backtick key.

brisk zodiac
#

is this right?

slate swan
#

yeps

spring flax
#

Can I have two logs (logging module) files for one code ?

hoary cargo
# sage otter 2 years != newbie

well, at some point i was a newbie myself, indeed i had some headaches trying to understand how pycharm works, but eventually i got it, you can't avoid stuff just because it's hard, there are many useful tools in there that can help you at any level

brisk zodiac
#

but it said this File "main.py", line 25
if message.content.startswith('.hug'):
^
SyntaxError: invalid syntax

slate swan
#

my head hurts after seeing such errors

spring flax
#

Lol

pliant gulch
#

Also no forced venv

slate swan
left crater
#

🤦‍♂️

slate swan
#

rip me, I get too open about my thoughts

cedar stream
slate swan
#

lol

#

anyways, bye

sage otter
vast gale
slate swan
vast gale
slate swan
#

wow, it has a vanity url

vast gale
hoary cargo
slate swan
vast gale
#

^

hoary cargo
vast gale
#

^

hoary cargo
#

how do you think you get boosts for the server

slate swan
vast gale
#

just take their money

this is not advice, please do not do this

hoary cargo
#

yeah

slate swan
#

welp

#

have some humanly values you both, lmao

hoary cargo
#

MR_uncanny_1 sarcasm

#

~~

slate swan
#

lool

#

"~~"

hoary cargo
#

shh

hoary cargo
# slate swan have some humanly values you both, lmao

MR_canny_meh_stage idk tho, tbh i never asked people to boost, sometimes ppl just join the server and be like "wow, this server nice" and boost even if they know no one in there lmao and i get confused bc i wouldn't waste my money on something i don't know nothing about

unkempt canyonBOT
#

7. Keep discussions relevant to the channel topic. Each channel's description tells you the topic.

vast gale
#

my sleep schedule definitely proves that

crimson moat
#

!code

hoary cargo
brisk zodiac
#

from keep_alive import keep_alive
import discord
import os
import random

client = discord.Client()

Picture = ["nothing", "Hello"]

Picturetwo = ["yo", "hi"]

@client.event
async def on_ready():
print("We have logged in as {0.user}".format(client))

@client.event
async def on_message(message):
if message.author == client.user:
return

if message.content.startswith('.hug'):
    await message.channel.send(random.choice(Picture))

if message.content.startswith('.kill'):
    await message.channel.send(random.choice(Picturetwo))

keep_alive()
client.run(os.getenv('TOKEN'))

#

This code work but it didn't reply when i send the commands

slim ibex
#

!code

unkempt canyonBOT
#

Here's how to format Python code on Discord:

```py
print('Hello world!')
```

These are backticks, not quotes. Check this out if you can't find the backtick key.

slim ibex
#

and I would use process_commands at the end of your on message listener

#

!d discord.ext.commands.Bot.process_commands

unkempt canyonBOT
#

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

This function processes the commands that have been registered to the bot and other groups. Without this coroutine, none of the commands will be triggered.

By default, this coroutine is called inside the [`on_message()`](https://discordpy.readthedocs.io/en/master/api.html#discord.on_message "discord.on_message") event. If you choose to override the [`on_message()`](https://discordpy.readthedocs.io/en/master/api.html#discord.on_message "discord.on_message") event, then you should invoke this coroutine as well.

This is built using other low level tools, and is equivalent to a call to [`get_context()`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.Bot.get_context "discord.ext.commands.Bot.get_context") followed by a call to [`invoke()`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.Bot.invoke "discord.ext.commands.Bot.invoke").

This also checks if the message’s author is a bot and doesn’t call [`get_context()`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.Bot.get_context "discord.ext.commands.Bot.get_context") or [`invoke()`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.Bot.invoke "discord.ext.commands.Bot.invoke") if so.
final iron
quick gust
spring flax
#
def setup_logger(name, log_file, level=logging.WARNING):

    handler = logging.FileHandler(log_file)        


    logger = logging.getLogger(name)
    logger.setLevel(level)
    logger.addHandler(handler)
    return logger

on_command_logs = setup_logger('on_command', 'on_commands.log')
command_errors = setup_logger('command errors', 'on_command_errors.log')

@bot.event
async def on_command_error(error):
    command_errors.warning('A command has errord')

Anyone mind telling me why on_command_error doesn't write into the logs file

#

what?

maiden fable
spring flax
maiden fable
spring flax
#

ctx, error?

maiden fable
#

Yea

spring flax
#

wait it does?

quick gust
#

yeah

maiden fable
#

lol

#

For some reason it doesn't work

quick gust
#

smh

spring flax
#

okay nvm it does

maiden fable
#

not even commands.on_command_error

quick gust
#

weird

spring flax
#

it should be this ^ no idea why it's not working (discord.on_command_error)

maiden fable
#

idk

quick gust
#

discord.ext.commands.Bot.on_command_error

#

!d discord.ext.commands.Bot.on_command_error

spring flax
#

!d discord.ext.commands.Bot.on_command_error

maiden fable
#

Wait what tf

quick gust
maiden fable
#

see the second one lol

quick gust
#

yeah

vast gale
slate swan
#

The first one is used inside the bot object when you subclass it iirc 🏃

vast gale
#

but the second one is an event reference except idk why it's under the main lib

cosmic agate
#

how to add oop to content message properly

slate swan
# vast gale well, all instances of it

I mean the event is usable without the event/listen decorator```py
class MyBot(Bot):
def init(self):
...

async def on_command_error(self, context,error):
   ...
slate swan
cosmic agate
#

like adding variables

cloud dawn
cosmic agate
#

?

slim ibex
cosmic agate
slate swan
cosmic agate
#

hmm

cloud dawn
#

You can just create attributes.

slate swan
cosmic agate
cloud dawn
#

!e ```py
class Object:
pass

a = Object()
a.somefield = "value"

print(a.somefield)

unkempt canyonBOT
#

@cloud dawn :white_check_mark: Your eval job has completed with return code 0.

value
slate swan
pliant gulch
cloud dawn
#

Pass the variable.

cosmic agate
#

no one helping

#

sed

slate swan
cloud dawn
#

!global

unkempt canyonBOT
#

When adding functions or classes to a program, it can be tempting to reference inaccessible variables by declaring them as global. Doing this can result in code that is harder to read, debug and test. Instead of using globals, pass variables or objects as parameters and receive return values.

Instead of writing

def update_score():
    global score, roll
    score = score + roll
update_score()

do this instead

def update_score(score, roll):
    return score + roll
score = update_score(score, roll)

For in-depth explanations on why global variables are bad news in a variety of situations, see this Stack Overflow answer.

slate swan
#

Which is being updated only inside that function's scope , not globally

#

use a botvar

pliant gulch
slate swan
#

!botvar same as your code

unkempt canyonBOT
#

Python allows you to set custom attributes to most objects, like your bot! By storing things as attributes of the bot object, you can access them anywhere you access your bot. In the discord.py library, these custom attributes are commonly known as "bot variables" and can be a lifesaver if your bot is divided into many different files. An example on how to use custom attributes on your bot is shown below:

bot = commands.Bot(command_prefix="!")
# Set an attribute on our bot
bot.test = "I am accessible everywhere!"

@bot.command()
async def get(ctx: commands.Context):
    """A command to get the current value of `test`."""
    # Send what the test attribute is currently set to
    await ctx.send(ctx.bot.test)

@bot.command()
async def setval(ctx: commands.Context, *, new_text: str):
    """A command to set a new value of `test`."""
    # Here we change the attribute to what was specified in new_text
    bot.test = new_text

This all applies to cogs as well! You can set attributes to self as you wish.

Be sure not to overwrite attributes discord.py uses, like cogs or users. Name your attributes carefully!

slate swan
#

How do i attach embed to bot's response?

left crater
slate swan
left crater
#

make an embed and then reply(embed=embed)

slate swan
#

i knoww but how do i make an embed?

#

JSON data?

#

why u used one string at variable ( ' ' )
and if heistar == "": (double string)

#

what's the traceback

#

btw

#

oh yeah i had this problem with my bots alot of times, idk why that not working

#

heistar is a private variable dude, wait no it isnt

hoary cargo
#

MR_canny_12 good practice, kick mee6 and dyno from your servers

slate swan
#

imagine using strings instead of jso or arrays 😭

#

!d discord.ext.commands.has_role

unkempt canyonBOT
#

@discord.ext.commands.has_role(item)```
A [`check()`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.check "discord.ext.commands.check") that is added that checks if the member invoking the command has the role specified via the name or ID specified.

If a string is specified, you must give the exact name of the role, including caps and spelling.

If an integer is specified, you must give the exact snowflake ID of the role.

If the message is invoked in a private message context then the check will return `False`.

This check raises one of two special exceptions, [`MissingRole`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.MissingRole "discord.ext.commands.MissingRole") if the user is missing a role, or [`NoPrivateMessage`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.NoPrivateMessage "discord.ext.commands.NoPrivateMessage") if it is used in a private message. Both inherit from [`CheckFailure`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.CheckFailure "discord.ext.commands.CheckFailure").

Changed in version 1.1: Raise [`MissingRole`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.MissingRole "discord.ext.commands.MissingRole") or [`NoPrivateMessage`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.NoPrivateMessage "discord.ext.commands.NoPrivateMessage") instead of generic [`CheckFailure`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.CheckFailure "discord.ext.commands.CheckFailure")
slate swan
#

its alright, welp

maiden fable
slate swan
#

nor can it be

maiden fable
slate swan
maiden fable
#

Hmmm, SUPER under utilized

slate swan
#

like what

maiden fable
#

Lmaoo

hoary cargo
maiden fable
#

Lmao

slate swan
#

You can add something which bans users with pycord or in their status or aboutme too

#

lol

maiden fable
maiden fable
slate swan
pliant gulch
#

If your bot used rin you could've gotten anti-raids as well

#

😼

maiden fable
#

andy

maiden fable
#

How's rin doing?

pliant gulch
#

My motivation is wilting

hoary cargo
maiden fable
slate swan
#

btw, how many choices can a parameter take in slashes?

hoary cargo
quaint epoch
#

what would a snipe command do exactly?

maiden fable
hoary cargo
slate swan
quaint epoch
slate swan
quaint epoch
maiden fable
quaint epoch
#

don't want bring down the gods wrath on me

slate swan
slate swan
boreal ravine
#

@quaint epoch so you were underage last year

quaint epoch
maiden fable
#

Okay, it doesn't say anything in developer docs, afais

hoary cargo
slate swan
#

I checked before you answered

quaint epoch
#

im still confused on the usage of a snipe command

maiden fable
maiden fable
quaint epoch
maiden fable
#

channel

slate swan
boreal ravine
#

both

hoary cargo
#

depends on you

quaint epoch
#

got it thanks

maiden fable
quaint epoch
#

I should be paying attention to geography but what kind of game dev needs to know geography on their resume?

unkempt canyonBOT
boreal ravine
#

please

slate swan
hoary cargo
maiden fable
slate swan
maiden fable
#

argh

regal pulsar
#

help anyone?

#

i made a basic ship command

#

which works fine

#

but im trying to rig it so if my friend and his crush are shipped then it defaults to 100%

slate swan
regal pulsar
#

that doesnt seem to work tho

regal pulsar
#

and i cant figure out whats wrong

slate swan
#

rip lemme check

regal pulsar
#

thanks 🙏

slate swan
regal pulsar
#

yeah i needed to add gifs to the embed too ;/

#

and since i set the embed values before i make the embed

#

and the gif after i make it

#

that complicates things

slate swan
#

okay I'm having a stroke trying to understand

regal pulsar
maiden fable
regal pulsar
#

sorry im a bit new to py ;/

#

so code's a bit messy

slate swan
maiden fable
#

Okay

regal pulsar
#

outermost if statement checks if the 2 people mentioned are my friend and his crush

#

if it isnt it runs like normal

slate swan
#

then return the send method

regal pulsar
#

yeah i did

#
if (
        768393728163053619 not in (person1.id, person2.id)
        and 536479129025904651 not in (person1.id, person2.id)
    ):
hoary cargo
#

ayo

slate swan
#

"thee"

#

reptilian Shakespeare?

regal pulsar
#

yeah im using async functions and await in my code

slate swan
#

lmao

regal pulsar
#

i get how that works

#

and i already have decorators for limiting commands to people with certain perms

#

im not at home and on a shit laptop that takes like 5 seconds to register text

#

so its a bit hard to debug

slate swan
#

@maiden fable choices can only take 25 fields 😔

maiden fable
#

Oh cool

hoary cargo
slate swan
merry charm
slate swan
merry charm
#

@regal pulsar

if person1.id in [friendsid, crushid]:
  if person2.id in [friendsid, crushid]:
    ship_percent == 101
slate swan
merry charm
#

😈

slate swan
outer parcel
#

does anyone have any idea for a currency bot

slate swan
#

no

manic wing
#

no

slate swan
#

caeeedennn

frozen elk
manic wing
#

ahsleytyyy

slate swan
merry charm
#
if person1.id in [friendsid, crushid]:
  if person2.id in [friendsid, crushid]:
    ship_percent == 101

@slate swan fixed it i think

#

idk why the args are person1 and person2

#

confusing asf

frozen elk
# frozen elk

TypeError: Errors.on_slash_command_error() takes 2 positional arguments but 3 were given

manic wing
slate swan
# frozen elk

does your stupidity really cut out the part where its your problem, at least tell the error

slate swan
frozen elk
manic wing
frozen elk
slate swan
merry charm
#

i have an idea

#

i want to make an "error log"

#

but should i

#

bc its rlly easy

#

but idk if its a good idea

#

@slate swan

#

like when an error goes off

#

it gets logged to a file with the error, error message, and time the error was called

#

and then ppl in the owner ids can check it

quick gust
#

why isn't that a good idea, I have it

merry charm
#

idk

#

im just bored

quick gust
#

then do it

merry charm
#

and thinking of anything

#

ok doing it rn

slate swan
honest vessel
#

the war has begun 😦

merry charm
honest vessel
#

@stray carbonconverrt message to lower chars

slate swan
merry charm
#

kk

#

okok

honest vessel
#

string.lower()

#

no

#

message.content

slate swan
#

string*,*lower

#

imagine

honest vessel
#

if 'heist' in message.content.lower()

#

lol

merry charm
cold sonnet
#

string.content?

merry charm
honest vessel
#

string. was just to mean its a string xD

#

str().lower()

merry charm
#

@slate swan i have an idea

cold sonnet
#

guys

maiden fable
honest vessel
#

its just example of what datatype

cold sonnet
#

?

honest vessel
#

string.lower()
str().lower()
"hellO".lower()

daring olive
slate swan
#

You don't need to create an instance

merry charm
#

@slate swan should i format it like

{
"errormessagehere": "timeoferror"
}
cold sonnet
#

oh well that way

honest vessel
#

@slate swanlol am just giving examples of .lower()

cold sonnet
#

right, you can make an instance

honest vessel
#

@merry charmif u want a dict yes

#

@slate swancause i said string.lower() and he thought he should type string.lower("H3Lo")

slate swan
honest vessel
#

@daring olivehand out a warning!

merry charm
honest vessel
#

well its key,value so

daring olive
honest vessel
tardy atlas
#

How to reset the value of a variable? sql

cold sonnet
merry charm
cold sonnet
unkempt canyonBOT
#
Not in my house!

No documentation found for the requested symbol.

honest vessel
slate swan
#

1 moment

merry charm
#

datetime.datetime.est.now()

honest vessel
#

!d datetime.datetime.now

unkempt canyonBOT
#

classmethod datetime.now(tz=None)```
Return the current local date and time.

If optional argument *tz* is `None` or not specified, this is like [`today()`](https://docs.python.org/3/library/datetime.html#datetime.datetime.today "datetime.datetime.today"), but, if possible, supplies more precision than can be gotten from going through a [`time.time()`](https://docs.python.org/3/library/time.html#time.time "time.time") timestamp (for example, this may be possible on platforms supplying the C `gettimeofday()` function).

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

This function is preferred over [`today()`](https://docs.python.org/3/library/datetime.html#datetime.datetime.today "datetime.datetime.today") and [`utcnow()`](https://docs.python.org/3/library/datetime.html#datetime.datetime.utcnow "datetime.datetime.utcnow").
slate swan
merry charm
#

@honest vessel will this work? datetime.datetime.est.now()

honest vessel
#

!e
import datetime
print(datetime.datetime.est.now())

unkempt canyonBOT
#

@honest vessel :x: Your eval job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "<string>", line 2, in <module>
003 | AttributeError: type object 'datetime.datetime' has no attribute 'est'. Did you mean: 'dst'?
merry charm
#

full code will probably be something like this ```py
with open("json/errorlog.json", "r") as f:
errors = json.load(f)
with open("json/errorlog.json", "w") as f:
errors[str(error)] = datetime.datetime.est.now()
json.dump(errors, f, indent=2)

#

!e ```py
import datetime
print(datetime.datetime.est.now())

unkempt canyonBOT
#

@merry charm :x: Your eval job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "<string>", line 2, in <module>
003 | AttributeError: type object 'datetime.datetime' has no attribute 'est'. Did you mean: 'dst'?
merry charm
#

!e ```py
import datetime
print(datetime.datetime.dst.now())

unkempt canyonBOT
#

@merry charm :x: Your eval job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "<string>", line 2, in <module>
003 | AttributeError: 'method_descriptor' object has no attribute 'now'
merry charm
#

thats weird

honest vessel
#

u just want datetime of now?

merry charm
honest vessel
#

what is est?

merry charm
#

eastent standard time

#

eastern

honest vessel
#

oh

tardy atlas
slate swan
#

!e py from datetime import datetime, timezone print(datetime.now(timezone("US/Eastern)))

unkempt canyonBOT
#

@slate swan :x: Your eval job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "<string>", line 2, in <module>
003 | AttributeError: type object 'datetime.timezone' has no attribute 'est'. Did you mean: 'dst'?
slate swan
merry charm
#
    with open("json/errorlog.json", "r") as f:
      errors = json.load(f)
    with open("json/errorlog.json", "w") as f:
      errors[str(error)] = datetime.datetime.est.now()
      json.dump(errors, f, indent=2)
    channel = bot.get_channel(931055707959197710)
    erroremb = discord.Embed(
      title = f"Error called in {ctx.guild.name}!",
      description = f"Error Below!\n`error`",
      color = discord.Color.red()
    )
    erroremb.set_footer(text=f"Error called by {ctx.author}", icon_url=ctx.author.avatar_url)
    await channel.send(embed=erroremb)
#

finished

#

just need datetime fixed and were good

#

!e ```py
import datetime
print(datetime.datetime.now())

unkempt canyonBOT
#

@merry charm :white_check_mark: Your eval job has completed with return code 0.

2022-02-24 15:34:24.995506
slate swan
merry charm
#

ok thats probably fine

slate swan
#

See the 1st answer

cold sonnet
#

note: avatar_url was changed in 2.0

merry charm
regal pulsar
#

nope

slate swan
regal pulsar
#

i wanna make the ship 100% if my friend and his crush are the ones being shipped

#

ill send updated ver i changed some stuff

merry charm
#

alr

slate swan
#
ship = # for othrs
them = [ your_friend_id, crush_id] 
if person1.id in them and person2.id in them:
   ship = 100
``` 🏃
regal pulsar
#

ive tried every possible thing i could think of to compare the two

merry charm
#

should i save the datetime as an interger or a string

merry charm
#

@slate swan

regal pulsar
#

but ill try again

slate swan
#

and change it when you send it

merry charm
#

kk