#discord-bots

1 messages · Page 1054 of 1

tropic burrow
#

why does this happen

#

in replit when i run the bot

placid skiff
#

cuz replit is ||shit||

#

Btw it seems something related to the token

tropic burrow
placid skiff
#

Bruh if the error is saying that the token is wrong then it is wrong, check it again

tropic burrow
#

k i double checked

#

it is correct

#

i do have a uptime robot monitor on a website created by

from flask import Flask

from threading import Thread



app = Flask('')



@app.route('/')

def home():

    return "I'm alive"



def run():

  app.run(host='0.0.0.0',port=8080)



def keep_alive():  

    t = Thread(target=run)

    t.start()
#

and i get this also

lyric apex
#

How to ignore specific command for a guild?

glad cradle
#

this photo is cropped

slate swan
# tropic burrow

In replit.com you often do os.environ["TOKEN"], not .getenv. Replit doesn't support .env files, that's why they have their own.

velvet trail
uneven crest
#

that is why you should not use repl.it, it has shared IP so ratelimits are shared

#

!d Member.joined_at

#

!d discord.Member.joined_at

unkempt canyonBOT
#

An aware datetime object that specifies the date and time in UTC that the member joined the guild.
If the member left and rejoined the guild, this will be the latest date. In certain cases, this can be None.

tropic burrow
uneven crest
#

Loop through the members and check against this attribute

uneven crest
lyric apex
uneven crest
#

It's an Embed

tropic burrow
visual island
lyric apex
slate swan
tepid siren
#

hi how can a discord bot detect if someones online? :)

slate swan
unkempt canyonBOT
#

property status```
The member’s overall status. If the value is unknown, then it will be a [`str`](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.10)") instead.
tepid siren
#

tnks

lyric apex
#

How would we take the description from website

slate swan
#

!src d

unkempt canyonBOT
#
Command: docs

Look up documentation for Python symbols.

Source Code
slate swan
#

check the source code

lyric apex
#

Ok

visual island
slate swan
#

😔id love it if there was a way to do it "safely" without making web reqs since all the docs are in the src and its saved on the device itself

hollow zealot
#

is there a website where i can see all the events things

tropic burrow
visual island
#

Show the full traceback, you just cut an important part

tropic burrow
visual island
#

!traceback | You missed the last part of the traceback.

unkempt canyonBOT
#

Please provide the full traceback for your exception in order to help us identify your issue.
While the last line of the error message tells us what kind of error you got,
the full traceback will tell us which line, and other critical information to solve your problem.
Please avoid screenshots so we can copy and paste parts of the message.

A full traceback could look like:

Traceback (most recent call last):
  File "my_file.py", line 5, in <module>
    add_three("6")
  File "my_file.py", line 2, in add_three
    a = num + 3
TypeError: can only concatenate str (not "int") to str

If the traceback is long, use our pastebin.

tropic burrow
light violet
digital mason
#

if you are hosting on repl.it you are probably using uptimerobot to keep the bot alive by pinging every few minutes, which causes the bot to be temporaily blocked by Discord

maiden fable
#

He's using replit so

dusky pine
#

Looool replit

oak bridge
#
import discord
import discord.ext.commands
import discord.state
import os

client = discord.Client()

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

I got a weird error

#

It returns this on the client = discord.Client() statement:

potent spear
#

since v2+ the intents kwarg is required

light violet
#

import discord
import discord.ext.commands
import discord.state
import os

client = commands.Bot(command_prefix="your prefix",intents=discord.Intents.all())

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

oak bridge
#

I ran the same code 1 month ago, and it worked before, so its weird.

I can't use client = discord.Client()?

light violet
#

no

potent spear
#

why wouldn't he?

#

I mean, he still can, but just needs to add the kwargs

light violet
#

maybe

slate swan
potent spear
#

there should be a valid reason why he wants to be on v2, else I'd just downgrade to v1.7.3

slate swan
#

application commands could be the main motive of using Client on 2.0

maiden fable
#

Yea lol

#

Isn't that the reason people moved to forks

hollow zealot
velvet compass
#

What were you doing with that website?

hollow zealot
velvet compass
#

Then you probably made too many requests and got ratelimited / blocked

hollow zealot
#

i change repl and now it works

potent spear
#

oof, replit

hollow zealot
#

?

potent spear
#

.

hollow zealot
#

uhhh

#

what else can i use for free that ran my bot for 24 hours?

vocal plover
# hollow zealot why?

The replit IP you were connecting from made over 10,000 4XX requests in the last ten minutes, meaning Cloudflare blocked you from accessing the site

vocal plover
#

yes

hollow zealot
#

but i created a new repl and now it worked?

vocal plover
#

It assigned you a different IP

hollow zealot
#

is it because i ran it multiple times?

vocal plover
#

The same thing will likely happen again soon

hollow zealot
potent spear
# hollow zealot am i the only one who use the ip?

Let's read together

  • They use a shared IP for everything running on the service.
    This one is important - if someone is running a user bot on their service and gets banned, everyone on that IP will be banned. Including you.
slender night
#

How to send an error message using slash commands which only the author can see and noone esle?

potent spear
#

it's a kwarg in the send_message method

hollow zealot
#

that ran 24 hours

#

is github the same?

potent spear
hollow zealot
potent spear
slender night
spring flax
#

If I want to get the first 100 members who joined the server, I can do something like this?

ordered_members = sorted(guild.members, key = lambda m : created_at)
return ordered_members[:100]
hollow zealot
potent spear
slender night
#

I can't find anything like inter.send_message

potent spear
spring flax
potent spear
spring flax
potent spear
hollow zealot
potent spear
slender night
#

@potent spear that worked, thank you so much.

hollow zealot
slender night
#

How long will it take to register 1 slash command?

potent spear
hollow zealot
potent spear
hollow zealot
slender night
potent spear
slender night
#

NVm its like not working

potent spear
#

show your code, to prove you're actually doing it for one guild

slender night
#

Its only 1 help command

#

I removed the auto complete thing

#

Maybe that would do something

slate swan
#

well, with the new api it takes like no time for even global commands to register~

potent spear
#

no idea, I don't have any experience with v2 stuff

slender night
potent spear
#

It's not suggested at all to hardcode your help command

slate swan
#

wrong decorator, wrong class

#

you gotta initialise that class

#

and since your using the commands.slash_command decorator you need to use the bot's method to add slash command manually

potent spear
#

yup, you're trying to organize your commands in different classes, but that's not how to do it

slate swan
#

could have used cogs.

oak bridge
#

hello guys, the bot logged in successfully but won't listen to any of these messages? why is that? maybe it is running the old version script? thank you

import discord
from discord.ext import commands
import discord.state

intents = discord.Intents.default()
client = discord.Client(intents=intents)

@client.event
async def on_ready():
    print(f"We have logged in as {client.user}")    
    print(f"list of client guilds: {client.guilds}")
    
    for guild in client.guilds:
        if guild.name == GUILD:
            break
    print(f"Guild name and ID are: {guild.name}, {guild.id}")


@client.event
async def on_message(message):

    if message.content == '99!':
        response = 'ss'
        await message.channel.send(response)


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

client.run(TOKEN)
slate swan
oak bridge
slate swan
#

you need to set intents.message_content to True

oak bridge
#

is that good to use 2.0 ? or downgrade it?

potent spear
slate swan
#

1.7.3 doesn't have app commands and other interactions, 2.0 does

oak bridge
#

I can't see the official doc has a good tutorial for their 2.0

slender night
#

Oh now it works

#

I am an idiot

#

I used commands.slash_command instead of client.slash_command.

slender night
#

@potent spear how to get the big icon infront of commands?

potent spear
slender night
slate swan
potent spear
slate swan
slender night
oak bridge
#

How to gives bot permission? now the bot cannot send messages in my server. Checking this bot, the setting wont save

slate swan
#
@bot.event
async def on_command_error(ctx, error):
    if isinstance(error, commands.CommandOnCooldown):
        print(ctx.command)``` this is my cooldown command, obviously im adding more but i need a way to GET the cooldown of the command invoked (**not** the time remaining, the actual cooldown)
oak bridge
#

I am adding a command that returns me the results of any functions (2.0 package)


intents = discord.Intents.default()
intents.message_content = True

client = discord.Client(intents=intents)

@bot.command()
async def show(str):
    print(f"Showing the results of: {str}")
    await exec(str)

!show guild.id --> It should show something.

But this code is not work. How to fix it?

slate swan
#
@bot.command()
async def show(ctx, str):
    print(f"Showing the results of: {str}")
    await exec(str)```
#

try that

and if u want the message to send in the channel, do await ctx.send(eval(str))
exec() always returns None but eval() returns the output

elfin summit
#

In cogs

import discord
from discord.ext import commands
from discord.ext.commands import has_permissions, CheckFailure

class Moderation(commands.Cog):
    """Moderation commands"""

    def __init__(self, bot):
        self.bot = bot

    @commands.command(name='kick')
    @has_permissions(kick_members = True)
    async def kick(self, ctx, *, member = discord.Member, reason=None):
        """kicks a member"""

        if reason == None:
            reason = 'no reason was provided lmao'
        await ctx.guild.kick(member)
        await ctx.send(f'User {member.mention} has been kicked for {reason}')

def setup(bot):
    bot.add_cog(Moderation(bot))

Getting error of
discord.ext.commands.errors.BadArgument: Converting to "ABCMeta" failed for parameter "member".

oak bridge
#

Trying

#

@bot.command()
async def show(ctx, str):
    print(f"Showing the results of: {str}")
    await ctx.send(eval(str))

It is not working in my test

oak bridge
slate swan
elfin summit
slate swan
oak bridge
slate swan
#

i dont think str will work as a variable since its an in-built function @oak bridge

slate swan
# oak bridge why print()?

eval('string') will return nothing because there was no output. just like if u make a python file and just put 'string' as the code

#

do eval(print(str))

slate swan
oak bridge
#
@bot.command()
async def show(ctx,arg):
    print(f"Showing the results of: {str}")
    await ctx.send(eval(arg))

This is not work

I want the bot could response !show client.user and return the result of client.user @slate swan

slate swan
#

etc. !show guild.id will show the current guild id

elfin summit
slate swan
elfin summit
#

Can't figure it out

slate swan
elfin summit
slate swan
slate swan
elfin summit
# slate swan yes
raise BadArgument('Converting to "{}" failed for parameter "{}".'.format(name, param.name)) from exc
discord.ext.commands.errors.BadArgument: Converting to "ABCMeta" failed for parameter "member".
slate swan
slate swan
slate swan
#

!pip jishaku quite flexible and safe.

unkempt canyonBOT
oak bridge
slate swan
dull terrace
#

The amount of copyright infringement in bots is insane

elfin summit
lusty anvil
#
@client.listen()
async def on_voice_state_update(self, member: Member, before: VoiceState):
        #Pings a user if they've never joined the voice chat before and aren't voice verified.
        print(self)
        channel = member.channel
        print(channel)

Okay so I am trying to get the channel of when the user joins the channel but this just gives me when they leave the channel how do I get it to give me the ID of the channel that they join?

slate swan
torn sail
#

!d discord.on_voice_state_update

unkempt canyonBOT
#

discord.on_voice_state_update(member, before, after)```
Called when a [`Member`](https://discordpy.readthedocs.io/en/latest/api.html#discord.Member "discord.Member") changes their [`VoiceState`](https://discordpy.readthedocs.io/en/latest/api.html#discord.VoiceState "discord.VoiceState").

The following, but not limited to, examples illustrate when this event is called...
slate swan
#

bot is only created the channel

torn sail
#

U have ur args wrong

#

self should only be used in classes

tired hinge
#

i don't think you're allowed to ask for help with destructive code such as this

lusty anvil
# slate swan can u show the output of `dir(self)`?

['abstractmethods', 'class', 'delattr', 'dir', 'doc', 'eq', 'format', 'ge', 'getattribute', 'gt', 'hash', 'init', 'init_subclass', 'le', 'lt', 'module', 'ne', 'new', 'reduce', 'reduce_ex', 'repr', 'setattr', 'sizeof', 'slots', 'str', 'subclasshook', '_abc_impl', '_client_status', '_copy', '_from_message', '_from_presence_update', '_get_channel', '_presence_update', '_roles', '_state', '_try_upgrade', '_update', '_update_from_message', '_update_inner_user', '_update_roles', '_user', 'activities', 'activity', 'add_roles', 'avatar', 'avatar_url', 'avatar_url_as', 'ban', 'block', 'bot', 'color', 'colour', 'create_dm', 'created_at', 'default_avatar', 'default_avatar_url', 'desktop_status', 'discriminator', 'display_name', 'dm_channel', 'edit', 'fetch_message', 'guild', 'guild_permissions', 'history', 'id', 'is_avatar_animated', 'is_blocked', 'is_friend', 'is_on_mobile', 'joined_at', 'kick', 'mention', 'mentioned_in', 'mobile_status', 'move_to', 'mutual_friends', 'mutual_guilds', 'name', 'nick', 'pending', 'permissions_in', 'pins', 'premium_since', 'profile', 'public_flags',
'raw_status', 'relationship', 'remove_friend', 'remove_roles', 'request_to_speak', 'roles', 'send', 'send_friend_request', 'status', 'system', 'top_role', 'trigger_typing', 'typing', 'unban', 'unblock', 'voice', 'web_status']

#

This is what it gives me for dir(self)

slate swan
#

ok great

#

just give me a second

velvet compass
#

!rule 5

unkempt canyonBOT
#

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

velvet compass
#

We absolutely won't help with a "nuke" command @slate swan

uncut jewel
#

Lol, their profile has an "antinuke" bot link that directs you to invite this bot probably... that seems malicious lol.

quaint epoch
#

it essentially is just a channel_clear command, made one of those myself

uncut jewel
#

Not today buddy...

quaint epoch
#

although the word "nuke" is real sus

heady sluice
#

what

tired hinge
#

nuking servers is honestly messed up

heady sluice
#

it says antinuke

quaint epoch
#

@slate swan is the code on github?

tired hinge
#

gonna regenerate my bot's token rq

lusty anvil
quaint epoch
uncut jewel
#

This code literally logs in, checks if has admin privileges, and if it does nukes. That's text book malicious...

quaint epoch
#

@slate swan just rename the command to channel_clear and it'll look a lot more normal smh

quaint epoch
#

it doesn't even take a guild_id, just a channel id lmao

sick birch
#

What’s the matter here

quaint epoch
quaint epoch
#

a guy named his channel_clear command to nuke and it looks sus as hell

uncut jewel
#

Fair, but seems sus..

#

not inviting his antinuke any time though lol

heady sluice
#

what he did is the safest way to delete all messages in a channel

sick birch
#

Brad already gave the verdict, no point in arguing. Let’s move on, shall we?

supple thorn
#

Lag?

quaint epoch
#

laggy as hell

#

never gonna purge 9999999999 messages again

#

i saw someone else do purge 9999999999 too

#

sed

heady sluice
#

that's nuking

quaint epoch
heady sluice
#

purging that many messages is nuking

slate swan
quaint epoch
vocal snow
velvet compass
heady sluice
heady sluice
quaint epoch
heady sluice
#

so he could do the same as this without the bot

quaint epoch
#

just do @commands.command(manage_channels=True)

quaint epoch
#

the code was so bad, it looks sus 🤣

#

.topic

lament depotBOT
#
**What commands/features are you proud of making?**

Suggest more topics here!

heady sluice
#

he could do many worse things without the bot

quaint epoch
#

why are you duping messages?

#

how do i know YOU are not a bot

heady sluice
#

why can't I just send messages normally

quaint epoch
heady sluice
quaint epoch
sick birch
# lament depot

Not really unique but I’m still proud of it: being able to give infractions on discord using my bot, and being able to delete them on the website 😊

heady sluice
#

so only the owner could do this

#

even though it's the safest method

native wedge
#

How to add perms to slash commands?

quaint epoch
#

advice for y'all just do py @bot.command() @commands.has_permissions(manage_channels=True) async def channel_clear(ctx): new = await ctx.channel.clone() await ctx.channel.delete() await new.send(f'{ctx.author.mention} channel cleared!')

#

don't use nuking anywhere

heady sluice
#

this is literally the same

quaint epoch
#

but this way is less sus

heady sluice
#

yeah just the name

slate swan
#

how do you print the client's username

heady sluice
#

you first have to log in to do this

#

you can do it in on_ready

slate swan
#

oh

#

i get it, thanks

sick birch
heady sluice
#

hehe right

#

it would still look weird

#

it would print many times in some days

#

cuz on_ready sucks

#

did u get reaction perms with the helpers role

#

or the events team

digital mason
#

What's the difference between on_message as an event and as a listener

quaint epoch
heady sluice
quaint epoch
#

^ i did this once by accident, thought it was a cool feature

#

never again

heady sluice
#

meaning it completely overwrites the default on_message

sick birch
heady sluice
sick birch
#

This is because on message gets called before all command handlers

digital mason
#

I want to make a riddle command that asks many riddles and gets many answers at the same time

#

Can I use on_message for that

quaint epoch
sick birch
#

that too

elder flower
#

Where to learn python for discord bot coding?

sick birch
#

actually there are plenty that get called before command handlers

#

But on message is an interesting case

quaint epoch
elder flower
sick birch
#

Or any YouTube tutorials

quaint epoch
#

check the pins, there are quite a few good tutorials

sick birch
heady sluice
#

mmm I would use a bool bot variable that I would turn on once using a command, then get the messages in a list while that var is True

elder flower
#

Is this python or js
If message content ===

sick birch
heady sluice
#

it's a way

sick birch
#

Strict equality operator

elder flower
quaint epoch
sick birch
#

It’s more lower level to the API

elder flower
#

Yes

heady sluice
#

I don't even have twitter

vocal plover
#

flashbacks to that time I made some bot tutorial videos 😳

sick birch
digital mason
#

Can wait_for be used simultaneously with many members

elder flower
sick birch
#

we here at discord bots collectively despise YouTube tutorials

quaint epoch
#

damn, i just realized i kept my p out of that little underwear hole in my shorts this whole time, gtg

vocal plover
#

In fairness they were correct

#

they still are for dpy 1.6 iirc

slate swan
#

i remade dank memer

digital mason
#

Like I ask many questions and I move to the next question if no one answers in 1min or someone answers correctly

quaint epoch
slate swan
#

dope name ik

quaint epoch
#

i smell copyright infringement

vocal plover
heady sluice
slate swan
vocal plover
#

I still need to spend a good few days updating my text-based tutorial

quaint epoch
elder flower
#

I can ping any role

heady sluice
#

hm

vocal plover
#

I decided for some idiotic reason to re-add discord.py so that's gonna be fun since it handles app commands totally differently

quaint epoch
heady sluice
elder flower
#

@heady sluice

heady sluice
#

wtf

slate swan
heady sluice
#

does this work with roles

#

can I ping a role for that I don't have permissions to ping

elder flower
#

@sick birch sup

vocal plover
#

no

native wedge
#

Add a & after the @

sick birch
slate swan
#

i found out how to pop out the veins in my head

#

now i look like megamind

sick birch
#

might wanna get that checked out

native wedge
elder flower
slate swan
#

ur lungs will feel like they are collapsing

elder flower
vocal plover
slate swan
#

or 198

sick birch
native wedge
#

It doesnt

vocal plover
elder flower
vocal plover
#

so like... dont

sick birch
#

I can’t tell because you pinged me in the message

slate swan
#

whats the point of living if ur just gonna die anyway

elder flower
#

<@&787816728474288181> here

sick birch
#

I see

rocky hornet
#

in on_connect what objects are available?

slate swan
rocky hornet
#

it wont

elder flower
#

It will

slate swan
#

!e import sys print(dir(sys))

sick birch
unkempt canyonBOT
#

@slate swan :white_check_mark: Your eval job has completed with return code 0.

['__breakpointhook__', '__displayhook__', '__doc__', '__excepthook__', '__loader__', '__name__', '__package__', '__spec__', '__stderr__', '__stdin__', '__stdout__', '__unraisablehook__', '_base_executable', '_clear_type_cache', '_current_exceptions', '_current_frames', '_deactivate_opcache', '_debugmallocstats', '_framework', '_getframe', '_git', '_xoptions', 'abiflags', 'addaudithook', 'api_version', 'argv', 'audit', 'base_exec_prefix', 'base_prefix', 'breakpointhook', 'builtin_module_names', 'byteorder', 'call_tracing', 'copyright', 'displayhook', 'dont_write_bytecode', 'exc_info', 'excepthook', 'exec_prefix', 'executable', 'exit', 'flags', 'float_info', 'float_repr_style', 'get_asyncgen_hooks', 'get_coroutine_origin_tracking_depth', 'getallocatedblocks', 'getdefaultencoding', 'getdlopenflags', 'getfilesystemencodeerrors', 'getfilesystemencoding', 'getprofile', 'getrecursionlimit', 'getrefcount', 'getsizeof', 'getswitchinterval', 'gettrace', 'hash_info', 'hexversion', 'implementation
... (truncated - too long)

Full output: https://paste.pythondiscord.com/vekaxoqero.txt?noredirect

rocky hornet
#

hm

elder flower
#

@rocky hornet

slate swan
#

it shows all functions and objects

rocky hornet
slate swan
rocky hornet
#

i asked what can i use while being inside on_connect

elder flower
digital mason
#

What if I add on_message as an event and also as a listener in a cog, will the on_message listener be fired when I run the command

slate swan
digital mason
elder flower
rocky hornet
# elder flower Yes

you clearly dont understand im asking in context of discord bot, which doesnt load every guild, every member, everything right on connect, dont you?

digital mason
#

Because I'm tryint to make a command that asks a question and receive answers from many

elder flower
rocky hornet
#

yeah wrong reply

slate swan
#

lmao

elder flower
rocky hornet
#

idk how discord is doing that

#

mobile client sucks

#

anyway @slate swan

slate swan
rocky hornet
#

you clearly misinterpreted my question

#

thus you are dismissed

slate swan
#

uh

digital mason
#

in their tos, they say that they offer their product as is, meaning that you agree to whatever they offer

sick birch
digital mason
#

Kinda sucks

sick birch
#

I hope that answers your question

slate swan
slate swan
#

someone give me ideas im bored as

half gale
#

discord.errors.ApplicationCommandInvokeError: Application Command raised an exception: ValueError: could not find open space for item
Is this because I'm adding too many items in the Modal?

rocky hornet
sick birch
rocky hornet
#

it also says that warnings in on_ready apply to on_connect too

sick birch
#

but usually theyll happen very close to each other

rocky hornet
#

I see

sick birch
rocky hornet
#

Im just trying to find out where it is best to start interactive REPL session

#

so i'd do that in on_ready when everything is ready

sick birch
#

An interactive repl session? Can I get more context?

rocky hornet
#

a separate thread that constantly asks for console input

#

it has different commands like send a message to channel

sick birch
#

I see

#

Probably in setup hook then

digital mason
#

Do I need a cog to add a listener

sick birch
digital mason
#

How

sick birch
#

!d discord.ext.commands.Bot.listen

unkempt canyonBOT
#

@listen(name=None)```
A decorator that registers another function as an external
event listener. Basically this allows you to listen to multiple
events from different places e.g. such as [`on_ready()`](https://discordpy.readthedocs.io/en/latest/api.html#discord.on_ready "discord.on_ready")

The functions being listened to must be a [coroutine](https://docs.python.org/3/library/asyncio-task.html#coroutine "(in Python v3.10)").

Example...
maiden fable
rocky hornet
#

now what setup hook are you talking about

#

the one that extensions define?

sick birch
#

It was introduced in 2.0

#

Unlike on ready, it’s only called once

rocky hornet
#

im on disnake

digital mason
sick birch
#

That’s more suited towards wait for

rocky hornet
#

!d discord.Client.wait_for

unkempt canyonBOT
#

wait_for(event, /, *, check=None, timeout=None)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).

Waits for a WebSocket event to be dispatched.

This could be used to wait for a user to reply to a message,
or to react to a message, or to edit a message in a self-contained
way...
rocky hornet
#

Bot is a subclass of Client, so ofc u can access this from bot instance

half gale
#

Does discord form allow only 5 items?

digital mason
sick birch
rocky hornet
#

@sick birch could you spawn docs for that setup hook thingy?

digital mason
#

But many will be using the bot not just one

sick birch
unkempt canyonBOT
#

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

A coroutine to be called to setup the bot, by default this is blank.

To perform asynchronous setup after the bot is logged in but before
it has connected to the Websocket, overwrite this coroutine...
half gale
sick birch
#

here you are

rocky hornet
digital mason
#

How does setup_hook work

sick birch
#

personally I’m not sure exactly when it gets called

#

but it’s async and only called once

robust fulcrum
#

Anyone help me at making a image search command pls
Me not getting good tutorial on Google

digital mason
#

I tried with a while loop that keeps asking for user input, and breaks when time between before the loop and current time has elapsed

rocky hornet
torn sail
digital mason
#

But wait_for blocked the bot so it kept waiting for a message

sick birch
#

wait for is not blocking

rocky hornet
digital mason
#

it blocked the bot

sick birch
#

That’s not possible if you’re doing it right

slate swan
#

it blocks the function until it gets the event, not your complete bot.

digital mason
#

Yes blocks the function

quaint epoch
#

i remember asking for help in this channel once on how to get an attachment and read the contents, no one gave me a concise answer, so if anyone is wondering - (await attachment.read()).decode() I hold my grudges

digital mason
#

For example if the bot should move to another question after no one answers in 2 minutes, wait_for keeps waiting for someone to answer

sick birch
#

Did you pass in a timeout?

rocky hornet
quaint epoch
digital mason
#

I guess yes

rocky hornet
#

any file is a sequence of bytes

quaint epoch
#

at the time, i didn't understand "bytes", and no one explained how to get a string from it

rocky hornet
#

you first need to make sure this is a text file

slate swan
#

hi guys..

sick birch
#

bytes and strings are notoriously difficult to work with

#

You work with strings in C or rust and you know why

rocky hornet
#

strings in C 🤔

sick birch
#

I would rather watch discord bot YouTube tutorials than work with strings in C

rocky hornet
#

but C doesnt have strings

sick birch
#

I know

#

char arrays are close

#

that’s why it’s such a pain

#

Rust it’s more of an encoding issue

quaint epoch
#

me who doesn't know C 🍿

rocky hornet
#

@sick birch you better think of C as an abstraction over assembly, and it suddenly makes a whole lot more sense

sick birch
#

I can see how that would make sense

#

I suppose assembly doesn’t have strings either

rocky hornet
#

lol

quaint epoch
unkempt canyonBOT
#

Assembly is a pythonic object-oriented, mid stack, batteries included framework built on Flask, that adds structure to your Flask application, and group your routes by class.Assembly allows developers to build web applications in much the same way they would build any other object-oriented Python program.Assembly Makes Flask Great Again!

slate swan
#

uh~

quaint epoch
#

eh

rocky hornet
#

do !pypi binary too

sick birch
#

terrible naming scheme

quaint epoch
#

!pypi asm

unkempt canyonBOT
quaint epoch
#

!pypi binary

unkempt canyonBOT
quaint epoch
#

check the src code first, they seem sus

rocky hornet
#

that was a joke comment

digital mason
slate swan
#

!pip brackets this looks like a fine Library lmao

unkempt canyonBOT
#

Use curly braces instead of indenting, plus much more sugar added to Python's syntax.

slate swan
#

Anyways ot

quaint epoch
digital mason
quaint epoch
#

HELL YEAH

#
while True:
  try:
    new_message = await bot.wait_for(event="on_message", timeout=69, check=lambda m: m.author == ctx.author and m.channel == ctx.channel)
  except asyncio.exceptions.TimeoutError:
    # do extra checks here
    if checks_not_met: continue
    
    else: break
  else:
    await ctx.send('timed out')
    break```
digital mason
#

I did that

#

But how to make sure that the while breaks if no one answers after 2 minutes

slate swan
#

timeout = 120

#

and break in the except

quaint epoch
slate swan
#
while True: 
     try: await wait_for("event", timeout = 120)
     except: break
quaint epoch
slate swan
# sick birch ???

they want to keep recording an event until someone doesn't respond within 2 minutes.

sick birch
#

my logic is flawed

vocal snow
#

bare except :(

slate swan
#

well, I didn't mention wait_for as bot.wait_for either, and the event name too xD

quaint epoch
hard sphinx
#

What is Key Metadata?

slate swan
#

did you do something with your pyproject.toml?

hard sphinx
#

I didn't even touch that file

grand shell
#

hey guys, is there a way to see what permissions a user has in a guild?

rocky hornet
#

or close to that :)

spring flax
#

how would I get the list of users who joined the server before x date?

grand shell
rocky hornet
rocky hornet
#

i just realized

#

name getch is get and fetch combined

grand shell
#

oh thats useful!

sick birch
spring flax
uncut atlas
#

@sick birch can you help me with some code?

sick birch
sick birch
spring flax
#

okay thank you

uncut atlas
#

So I'm not sure what's wrong

quaint epoch
#

i can't read that with my bat eyesight

uncut atlas
#

That's on my school laptop

quaint epoch
#

can't help if i can't see the question or the error

uncut atlas
#

Discord is block on it

quaint epoch
spring flax
slate swan
#

hello, ive been trying to make it so when a mention is sent it updates the channel for that user and sends an embed into a specific channel, however, it wont send the embed to the channel. I don't get any errors...```py
elif message.mentions:
user = message.mentions[0]
await message.channel.set_permissions(user, read_messages=True, send_messages=True, embed_links=True, attatch_files=True)
await message.reply(f"{user.mention}", embed=discord.Embed(description=f'{user.mention} was added to the ticket {message.channel.mention}', color=0x57f287))
mycursor.execute(f"SELECT * FROM t_info WHERE channelID = {message.channel.id}")
for o in mycursor:
req_embed = discord.Embed(title="Middleman Request!", description=f"<@{o[0]}> is looking for a middleman!\nOther Trader: {user.mention}\nTrade: {o[3]}", color=0xe15252)
guild=bot.get_guild(901481491337465928)
join_msg=guild.get_channel(975083898365157376)
await join_msg.send("<@&925444830480453644>", embed=req_embed)

sick birch
slate swan
#

how to create a channel under a specific category?

sick birch
#

Since those are integers you can do regular comparison operators

ornate linden
#

not sure if this makes sense but if a user sends just my command prefix can I make that execute a function?

#

like run my help command

sick birch
#

Don’t believe so

steady solstice
#

can anyone help me with this

#

see

#

please help me

heady sluice
#

!d discord.CategoryChannel

unkempt canyonBOT
#

class discord.CategoryChannel```
Represents a Discord channel category.

These are useful to group channels to logical compartments...
steady solstice
#

guys can anyone help me even

steady solstice
heady sluice
#

!d discord.CategoryChannel.create_text_channel @slate swan

unkempt canyonBOT
#

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

A shortcut method to [`Guild.create_text_channel()`](https://discordpy.readthedocs.io/en/latest/api.html#discord.Guild.create_text_channel "discord.Guild.create_text_channel") to create a [`TextChannel`](https://discordpy.readthedocs.io/en/latest/api.html#discord.TextChannel "discord.TextChannel") in the category.
heady sluice
#

and be more patient

#

be patient stop messaging in DMs

steady solstice
#

okay

heady sluice
#

stop spamming

steady solstice
#

sorry

heady sluice
steady solstice
#

very very sorry i apolizise

heady sluice
#

go to your application on that link and enable the intents you're requesting in code

heady sluice
steady solstice
#

why does my bot keep reseting token?

#

@heady sluice

heady sluice
#

it doesn't

steady solstice
#

okk

heady sluice
#

there's no way the token resets unless you do it

steady solstice
#

se a production WSGI server instead.

  • Debug mode: off
  • Running on http://0.0.0.0:8080/ (Press CTRL+C to quit)
    Traceback (most recent call last):
    File "main.py", line 336, in <module>
    bot.run(token)
    File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/client.py", line 723, in run
    return future.result()
  • Serving Flask app "" (lazy loading)
  • Environment: production
    WARNING: This is a development server. Do not use it in a production deployment.
    Use a production WSGI server instead.
  • Debug mode: off
  • Running on http://0.0.0.0:8080/ (Press CTRL+C to quit)
    Traceback (most recent call last):
    File "main.py", line 336, in <module>
    bot.run(token)
    File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/client.py", line 723, in run
    return future.result()
    File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/client.py", line 702, in runner
    await self.start(*args, **kwargs)
    File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/client.py", line 665, in start
    await self.login(*args, bot=bot)
    File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/client.py", line 511, in login
    await self.http.static_login(token.strip(), bot=bot)
    File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/http.py", line 300, in static_login
    data = await self.request(Route('GET', '/users/@me'))
    File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/http.py", line 216, in request
    raise HTTPException(r, data)
    discord.errors.HTTPException: 429 Too Many Requests (error code: 0): You are being blocked from accessing our API temporarily due to exceeding our rate limits frequently. Please read our docs at https://discord.com/developers/docs/topics/rate-limits to prevent this moving forward.
Discord Developer Portal

Integrate your service with Discord — whether it's a bot or a game or whatever your wildest imagination can come up with.

#

thsi error came

#

help me

#

@heady sluice

heady sluice
#

you got ratelimited

#

are you hosting on replit?

steady solstice
#

yep

heady sluice
#

yikes

steady solstice
#

lol

#

is it bad

heady sluice
#

yes

steady solstice
#

do i have to do in visual studio code

#

then how will i host it?

heady sluice
#

yes

#

there's a thread for discord bot hosting

#

and a pinned message here

cloud dawn
#

Develop locally, host on a vps.

rocky hornet
#

how to write unit tests for discord bots?

steady solstice
#

how to host a bot on visual studio code

rocky hornet
#

lol what

heady sluice
#

IDEs != hosts

steady solstice
#

not on visual studio code

#

i mean

cloud dawn
#

localhost

steady solstice
#

local host?

rocky hornet
#

hosts.txt

cloud dawn
rocky hornet
#

python -m bot

slate swan
rocky hornet
#

?

slate swan
#

I'm trying to make it so that when a used ID is sent it updates the perms for that member and sends a message, then i want it to send an embed in a specific channel, BUT, it doesn't seem to work and i'm not sure how to resolve it..py elif message.mentions: db = mysql.connector.connect( host="", user="", passwd="", database="") mycursor = db.cursor() user = message.mentions[0] await message.channel.set_permissions(user, read_messages=True, send_messages=True, embed_links=True, attatch_files=True) await message.reply(f"{user.mention}", embed=discord.Embed(description=f'***{user.mention} was added to the ticket {message.channel.mention}***', color=0x57f287)) print(1) mycursor.execute(f"SELECT * FROM t_info WHERE channelID = {message.channel.id}") print(2) for o in mycursor: print(3) req_embed = discord.Embed(title="Middleman Request!", description=f"**Trade:** {o[3]}", color=0xe15252) guild=bot.get_guild(901481491337465928) join_msg=guild.get_channel(975083898365157376) await join_msg.send("<@&925444830480453644>", embed=req_embed)

steady solstice
heady sluice
#

it's !Ashley

#

😮

rocky hornet
cloud dawn
steady solstice
#

bruh

#

i want like uptimerobot

cloud dawn
#

Why do you need a host if the bot isn't finished..?

slate swan
#

in any case.. hosting it locally.. would need your system to be ON lmao

rocky hornet
#

if you want a free hosting for a small bot, railway.app is decent

steady solstice
#

i just need it to be host

slate swan
#

and again.. free hosts gonna have their limitations

#

ppl usually use repl, heroku afaik

slate swan
rocky hornet
rocky hornet
#

repl.it uses shared ips so it automatically sucks

steady solstice
#

how to get a project on github?

slate swan
rocky hornet
slate swan
#

heroku has limited dyno hours

slate swan
rocky hornet
cloud dawn
steady solstice
slate swan
heady sluice
#

can't you just make two apps for the same code

slate swan
steady solstice
#

soi can host it from railway.app

heady sluice
#

and start the other when one's hours are gone

steady solstice
rocky hornet
#

idk, my bot runs 24/7 on heroku

slate swan
steady solstice
#

yes

#

or heroku

rocky hornet
#

💀

heady sluice
#

heroku uses github

uncut atlas
#

@quaint epoch

rocky hornet
slate swan
#

they aren't using it

heady sluice
#

o

slate swan
#

tho they are trying to fix it.. but for now, nope

quaint epoch
heady sluice
#

I didn't know

rocky hornet
#

for sexurity

quaint epoch
slate swan
#

yeah some token shit happened

rocky hornet
#

close enough

quaint epoch
slate swan
#

so for now.. one have to use Heroku CLI

quaint epoch
slate swan
#

💀 idk.. just look up on youtube or whatever.. whateveru feel comofrtable

slate swan
rocky hornet
cerulean heart
#

Traceback (most recent call last): File "main.py", line 475, in <module> client.run(os.getenv('TOKEN')) File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/client.py", line 708, in run return future.result() File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/client.py", line 687, in runner await self.start(*args, **kwargs) File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/client.py", line 650, in start await self.login(*args, bot=bot) File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/client.py", line 499, in login await self.http.static_login(token.strip(), bot=bot) File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/http.py", line 291, in static_login data = await self.request(Route('GET', '/users/@me')) File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/http.py", line 209, in request raise HTTPException(r, data) discord.errors.HTTPException: 429 Too Many Requests (error code: 0): You are being blocked from accessing our API temporarily due to exceeding our rate limits frequently. Please read our docs at https://discord.com/developers/docs/topics/rate-limits to prevent this moving forward

#

the bot is not running

rocky hornet
#

bruh

steady solstice
#

btw how to run the thing on visual studio code (python)

slate swan
rocky hornet
steady solstice
slate swan
#

see your bot page

steady solstice
#

how to run

slate swan
#

...

quaint epoch
#

how do you navigate

cerulean heart
slate swan
#

💀 if file is in the same directly.. with name main.py then command is ```py
python main.py

slate swan
rocky hornet
quaint epoch
slate swan
cerulean heart
steady solstice
cerulean heart
#

cuz it was running fine earlier

rocky hornet
slate swan
#

it hsould have something imo

cloud dawn
slate swan
heady sluice
slate swan
slate swan
rocky hornet
#

how do people even find replit

steady solstice
#

PS C:\Users\DELL\Desktop\tdfhgfdswedsa-2> python main.py
Program 'python.exe' failed to run: The application cannot be started because it is currently updatingAt line:1 char:1

At line:1 char:1

  • python main.py
  •   + CategoryInfo          : ResourceUnavailable: (:) [], ApplicationFailedException
      + FullyQualifiedErrorId : NativeCommandFailed
    
    

PS C:\Users\DELL\Desktop\tdfhgfdswedsa-2> main.py
name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1

  • main.py
  •   + CategoryInfo          : ObjectNotFound: (main.py:String) [], CommandNotFoundException
      + FullyQualifiedErrorId : CommandNotFoundException
#

this error comming

cloud dawn
#

More like repelit py_guido

cerulean heart
#

what should I do?

heady sluice
#

called it

slate swan
# slate swan yes

that's a bad practice.. better subclass commands.Bot & connect to it on its init method only

#

that's my imo btw..

cloud dawn
slate swan
slate swan
sick birch
rocky hornet
slate swan
#

that's what i mean, subclass the bot. it's the most effective way when dealing with dbs in discord bots

rocky hornet
#

💀

slate swan
#

💀 your choice bro

#

so can you help me with the actual code i sent?

#

actually, use an async library.

#

!pip aiomysql in your case

unkempt canyonBOT
slate swan
#

^ +1

sick birch
#

I dislike these drivers

slate swan
#

if you use 2.0, you can use the setup_hook to setup your connection.

rocky hornet
#

ok

sick birch
#

maybe just me tho

heady sluice
#

just you

sick birch
#

Look into an ORM

rocky hornet
#

init is better

#

you may use db before starting the bot

slate swan
heady sluice
#

so why do you have to subclass for that

slate swan
#

setup_hook is an coroutine, thats the point

#

eh you dont really need to subclass to use setup_hook

#
bot = commands.Bot()
async def my_func(bot):
  ...
bot.setup_hook = my_func 
heady sluice
#

in asyncpg, connecting to a db isn't async iirc, just the calls

#

I could connect to the db with just
bot.db = connectshit

slate swan
#

idk, libraries like aiosqlite use coroutines for that

heady sluice
#

after bot = commands.Bot

heady sluice
#

well I definitely didn't have to await

slate swan
#

you will have to

heady sluice
#

or did I do it in asyncio.run?

heady sluice
#

yeah probably

rare saddle
#

How to do the right check? If the verification level on the server is high, then ...

quaint epoch
#

🍿

slate swan
#

!d discord.Guild.verification_level

unkempt canyonBOT
slate swan
#

just use == "high" um?

slate swan
#

idk then

#

o

frigid apex
#

i use cogs and wanna timeout a user how do i do it?

code:

# timeout user
time = humanfriendly.parse_timespan(time)  # convert time to seconds
await member.timeout_for(time, reason)```

whats wrong? how do i fix it?
error
```error
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: TypeError: timeout_for() takes 2 positional arguments but 3 were given```

how do i timeout them?
slate swan
#

what library>?

#

hello, so what would be the diff between async def bla(something = None) and async def bla(something)

slate swan
#

!e

def a(arg):
    print(1)
a()
unkempt canyonBOT
#

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

001 | Traceback (most recent call last):
002 |   File "<string>", line 3, in <module>
003 | TypeError: a() missing 1 required positional argument: 'arg'
slate swan
#

!e

def a(arg = None):
    print(1)
a()
unkempt canyonBOT
#

@slate swan :white_check_mark: Your eval job has completed with return code 0.

1
slate swan
#

gotcha

frigid apex
slate swan
# frigid apex pycord

reason is a kwarg ```py

timeout user

time = humanfriendly.parse_timespan(time) # convert time to seconds
await member.timeout_for(time, reason=reason)```

warped mirage
#

can someone help me in a few mins?

sick birch
warped mirage
#

wait ima be back

frigid apex
#

@slate swan i tried this

slate swan
frigid apex
#

oh sorry lost

frigid apex
slate swan
#

use datetime timedelta

frigid apex
#

i use datetime

slate swan
#

!d datetime.timedelta

unkempt canyonBOT
#

class datetime.timedelta(days=0, seconds=0, microseconds=0, milliseconds=0, minutes=0, hours=0, weeks=0)```
All arguments are optional and default to `0`. Arguments may be integers or floats, and may be positive or negative.

Only *days*, *seconds* and *microseconds* are stored internally. Arguments are converted to those units...
slate swan
#

U can use this

slate swan
frigid apex
slate swan
#

don't name all var same

frigid apex
#

it works now

slate swan
#

Nice

ancient wraith
#

i wanna learn nural networks an more ai stuff how can i start?

warped mirage
slate swan
ancient wraith
#

oh sorry wrong channel

slate swan
#

My discord is glitched

#

it's not showing today at its showing 20 may....

warped mirage
#

bunch of these

slate swan
#

Uh

slate swan
slate swan
#

!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

slate swan
#

Ye it's fine now

#

Imagine indents error

warped mirage
#

idk

slate swan
#

better send an ss

warped mirage
#

ok

slate swan
#

Did u removed those ```py

warped mirage
#

i have quite alot so ill send the code in parts

slate swan
#

Ye sure

warped mirage
#

first this ig

slate swan
#

First indent here we go

slate swan
warped mirage
#

ok

slate swan
#

Imagine

warped mirage
#

it still shows as an error smh

slate swan
#

@warped mirage did u copied code from somewhere

slate swan
warped mirage
slate swan
#

Also

#

It will end on else

#

Nvmd

warped mirage
slate swan
#

Show

warped mirage
#
if level < 5:
            xp = random.randint(1, 3)
            async with client.db.execute("UPDATE levels SET xp = ? WHERE user = ? AND guild = ?", (xp, author.id, guild.id,)) as cursor:
        else:
            rand = random.randint(1, (level//4))
            if rand == 1:
              xp = random.randint(1, 3)
              async with client.db.execute("UPDATE levels SET xp = ? WHERE user = ? AND guild = ?", (xp, author.id, guild.id,)) as cursor:
        if xp >= 100:
        level += 1
        async with client.db.execute("UPDATE levels SET level = ? WHERE user = ? AND guild = ?", (level, author.id, guild.id,)) as cursor:
        async with client.db.execute("UPDATE levels SET xp = ? WHERE user = ? AND guild = ?", (0, author.id, guild.id,)) as cursor:
        await message.channel.send(f"{author.mention} has leveled up to level **{level}**!")
        await client.db.commit()
```  this is currently what i have
slate swan
#

Ss

slate swan
#

Bruh

#

jesus

warped mirage
#

xD

slate swan
#

No ofc

warped mirage
#

yes , i use to be good , but i recently came back and idk indents give me a breakdown

slate swan
warped mirage
slate swan
#

lol jk

#

Cap

warped mirage
#

indents is my only problem i need to get better at

slate swan
#

Huh

cloud dawn
#

Coding is pretty much riding a bike.

slate swan
#

Cycle*

warped mirage
#

so what now xd

warped mirage
cloud dawn
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

slate swan
cloud dawn
#

That planet looks like uranus

slate swan
#

Lol

#

it's saturn

#

there's a nice number of indent problems and syntax errors tbh

cloud dawn
slate swan
#

Lol

warped mirage
#

looking much better

slate swan
#

Bro

warped mirage
maiden fable
#

!d discord.Guild.premium_boosts

unkempt canyonBOT
#
Not gonna happen.

No documentation found for the requested symbol.

slate swan
slate swan
maiden fable
#

Uh

slate swan
#

hunter enters

maiden fable
#

I am out

warped mirage
slate swan
#

Lmao

cloud dawn
slate swan
warped mirage
#

wait i think i found

#

the async moved back and if into the thing

maiden fable
#

!d discord.Guild.premium_subscription_count @slate swan

unkempt canyonBOT
slate swan
maiden fable
#

Smh can't Danny name this as simple as boosts

slate swan
#

Ye

#

Lol

maiden fable
#

u can use message.guild or ctx.guild

#

Sure

slate swan
#

Bruh

maiden fable
#

No wait

slate swan
#

Lol

maiden fable
#

guild.premium_subscription_count

warped mirage
#

lmao im so pissed xD

slate swan
maiden fable
slate swan
slate swan
slate swan
maiden fable
#

Agreed

warped mirage
candid remnant
#

Hey

slate swan
warped mirage
#

On my code

slate swan
candid remnant
#

So I made wordle in python, and I think it would be cool if I added it to discord, too

warped mirage
#

Ok

slate swan
#

Ok

candid remnant
#

i just dont know how lol

#

Idk how to like make a command, so when you run it, it will wait for ur response, edit a specific message that it will send at the start of the game, and continue doing so

slate swan
#

Do u know basics of d. Py

candid remnant
#

not really

#

I mean if you know a guide that explains what I'll need to make wordle in discord, I'll be down to read it

maiden fable
#

Ash do be writing an essay

slate swan
#

Ye

candid remnant
#

Ashley is typing...

slate swan
#

Tutorial one

slate swan
#

U copy

maiden fable
slate swan
#

😭

#

u copied the text

slate swan
#

okimii's eyes are scary

#

Ye

#

now I got a creepy picture

#

Ash the snail typer 🐌

maiden fable
#

Discord still shows as typing if u don't type smth, for a min or two or if u leave a char in the textbox

slate swan
#

It's only 10 sec but

slate swan
#

indents are just to separate through code blocks

#

its really that easy to explain

maiden fable
#

Prolly I am wrong but 🤷‍♀️

slate swan
#

i just tested xd

#

Ye it's around 10

slate swan
# warped mirage indents is my only problem i need to get better at

How indents are actually used are if you want a piece of code to function under one specific condition (not if-else)

if condition:   <------------
  print("yes")              |
  print("whatever")         |
  else: #this will error as | is not inside another conditional and is a standalone conditional, this `else` errors out because an `else` cannot be used without an `if` and as you can see that you are embedding an `else` inside an `if` which further does not contain an `if` inside the root `if` and only an `else` this is the reason why your code was erroring out with indent errors
    ...


async with something() as smth:
  ''' Here you will have to perform a task or `pass` or use an Ellipsis for this temporary open statement '''
'''else anything you write under it will error out '''
''' For example '''

async with something() as smth:
if new_condition:
  ... #this errors out, refer to the above message

Refer to this -> #discord-bots message

(apologies for the ghost ping earlier, I had to correct my shitty grammar 😔)

#

🥱

#

anyways, I know, someone will find a mistake out of this too, you're welcome

#

this message makes me wanna cringe

warped mirage
#

im so damn confused ......

slate swan
#

Lol

#

im leaving, bye

#

bye

warped mirage
#

bruh

#
@client.event 
sad moment```
slate swan
#

Syntax error

#

How do you actually expect us to help you with indents 😭

#

Rip 5 min typn

slate swan
warped mirage
slate swan
slate swan
placid verge
#

Hello, well, as you know, when the bot turns off and on, it no longer responds to the buttons that were sent before it was turned off, and we have to send new buttons. How can I make it start responding to buttons that were made before it was turned off?

warped mirage
#

fix*

slate swan
placid verge
#

does this work for pycord too ?

maiden fable
#

Yea

slate swan
warped mirage
#

nah im serious lol

slate swan
#

hiy a

brave forge
#

If you do not understand what exactly I am writing, do not even try to say anything, do not provoke me to insults.
how to put a class for buttons in a file where you already have a class with cog. Please read the message above!!!