#discord-bots

1 messages · Page 868 of 1

quaint epoch
#

i can but i can't explain to other 13 year olds in my server to not send messages for 3 seconds

#

fucking teenagers

#

anyway i gotta go do art now

slate swan
manic wing
#

whelp dont turn your bot off

quaint epoch
#

i can't be sidetracked

quaint epoch
slate swan
coarse anvil
#

o

frozen patio
#

alright im trying to make a mod mail bot

#

and modmail_channel is not defined

manic wing
#

you used double =

frozen patio
#

yeah

#

am I not supposed to?

manic wing
#

you use single = for defining variables

#

== for comparisons

frozen patio
#

ahhhhh

slim ibex
#

prolly should learn more Python before getting deeper into the bot

cold sonnet
#

f-strings: sadcatthumbsup

#

nextcord: happyzoliba

left crater
#

whats wrong with f strings

cold sonnet
#

Jonathan doesn't use them

modest plover
#
@commands.slash_command()
	async def botinfo(self, inter):
		infoEmbed = disnake.Embed(
			title = "Heya!",
			description = "This is a description."
			.add_field(
				name = "Hey!",
				value = "Please work..."
			)
		)
		await inter.response.send_message(embed=infoEmbed)

I get an error with this when the command is run

#
disnake.ext.commands.errors.CommandInvokeError: Command raised an exception: AttributeError: 'str' object has no attribute 'add_field' 
#

Any idea why?

cold sonnet
#

"This is a description is a string"

#

'str' object has no attribute 'add_field'

#

place add_field outside of the embed constructor

#

outside of the brackets

modest plover
#

It works now! Thanks!

final iron
kind cargo
#
[WinError 2] The file can not be found.```
Any1 know this problem?
final iron
modest plover
#

Calling it bot_info makes it break, as in it doesn't load it

final iron
#

Never said anything about function names

kind cargo
#
[WinError 2] The file can not be found.```
Any1 know this problem?
I need som help
final iron
#

Stop spamming

kind cargo
#

Okay sorry...

modest plover
final iron
final iron
#

It's incredibly useful

fair rune
#

ok

slim ibex
#

it wouldn’t exist if they didn’t think it was necessary

modest plover
#

How do I use a custom emoji in an embed from a specific server?

left crater
#

<:emojiname:emoji_id>

modest plover
#

How do I get the id?

left crater
#

right click on the emoji

fair rune
final iron
#

Think about what you just said

left crater
modest plover
left crater
modest plover
#

🎱 (using this as an example)

left crater
#

idk then

fair rune
left crater
#

i dont use mobile

vale sierra
#

hello, i have a new problem that appears and i don't know how to fix it, this is my code : ```python
@tasks.loop(seconds = 5)
async def changeStatus():
game = discord.Game(random.choice(status))
await bot.change_presence(activity = game)

status = ["+help | Dr Maboule#4456", "Hello world"]

final iron
fair rune
#

ok

fair rune
final iron
left crater
#

also its outside the function

vale sierra
#

ok its really strange is was never problem with this before

fair rune
#

you are trying to use the list before it even exists i think it would probably be an issue

kind cargo
#

any1 help me?

fair rune
kind cargo
kind cargo
final iron
#

Code?

vale sierra
# left crater put status before game
@tasks.loop(seconds = 5)
async def changeStatus():
status = ["+help | Dr Maboule#4456", "Hello world"]
    game = discord.Game(random.choice(status))
    await bot.change_presence(activity = game)
``` like this ?
kind cargo
kind cargo
kind cargo
kind cargo
vale sierra
#

@left crater thats dont work

final iron
left crater
left crater
vale sierra
left crater
#

error?

vale sierra
scarlet aurora
#

!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.

scarlet aurora
#

https://paste.pythondiscord.com/vimewadiki ``` File "C:\Users\llVll\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\client.py", line 343, in _run_event
await coro(*args, **kwargs)
File "C:\Users\llVll\Desktop\TMG Bot\main.py", line 16, in on_ready
bot.load_extension("cogs.maincommands")
File "C:\Users\llVll\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\ext\commands\bot.py", line 678, in load_extension
self._load_from_module_spec(spec, name)
File "C:\Users\llVll\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\ext\commands\bot.py", line 609, in _load_from_module_spec
raise errors.ExtensionFailed(key, e) from e
discord.ext.commands.errors.ExtensionFailed: Extension 'cogs.maincommands' raised an error: AttributeError: module 'discord.ext.commands' has no attribute 'event'

manic wing
#

also you need self, message and self, ctx

#

classes take self as their first arg

scarlet aurora
#

oh yes i forgot about that

#

thanks

manic wing
#

line 212 be wildin

#

jeez ive seen everyone copy and paste that crap tictactoe command

#

its not even good, it uses global

vale sierra
#

someone now why bot don"t want to reply when a command is a embed ?

scarlet aurora
#

you gotta send the embed

#

embed=embed

#

await ctx.send(embed=embed)

#

after u built ur embed

vale sierra
#

i now

scarlet aurora
#

is there an error code?

vale sierra
#

no one its appears right know

scarlet aurora
#

what appears

vale sierra
#

this "bug"

#
@bot.command()
async def disquette(ctx):
    embed = discord.Embed(title = "✉️ **Disquette**", description = f"{ctx.author.mention} {random.choice(disquettes)}", color = 0x9400D3)

    await ctx.send(embed = embed)

@bot.command()
async def blague(ctx):
    embed = discord.Embed(title = "🤣 **Blague**", description = f"{ctx.author.mention} {random.choice(blagues)}", color = 0x9400D3)

    await ctx.send(embed = embed)

@bot.command()
async def meme(ctx):
    await ctx.send(f"> {ctx.author.mention} : Clique sur le lien pour télécharger la vidéo ! {random.choice(memes)}")

@bot.command()
async def nombrerandom(ctx):
    nombre = random.randint(0, 1000)
    embed = discord.Embed(title = "1️⃣  **Nombre**", description = f"{ctx.author.mention} {nombre} !", color = 0x9400D3)

    await ctx.send(embed = embed)

@bot.command()
async def pileouface(ctx):
    embed = discord.Embed(title = "❔ **Pile ou face**", description = f"{ctx.author.mention} {random.choice(pileouface)} !", color = 0x9400D3)
    
    await ctx.send(embed = embed) ``` @scarlet aurora  maybe because the {random.choice(-----)} is on the end of my code ?
scarlet aurora
#

make sure it's indented

#

idk

vale sierra
#

yes its

quaint epoch
#

how do i find a members status?

#

like my status is Why do I hafe tp fix typos?

frozen patio
#

what does the error mean?

quaint epoch
# frozen patio

what are you trying to do when you assignment empty a value?

#

because empty is a list, and lists have no attr array

frozen patio
quaint epoch
frozen patio
#

yes

#

something like that

quaint epoch
frozen patio
#

what is len?

quaint epoch
frozen patio
#

ah

#

what about line 8?

#

how do I fix that one?

quaint epoch
#

you don't need it, just use len()

radiant rampart
#

Hey joe cena any chance you can help me with my bot here once you’re done helping jonathan55?

frozen patio
#

mine had a minor bug

quaint epoch
radiant rampart
frozen patio
#

noq

radiant rampart
#

I’ve got everything working, but it won’t force it on them

frozen patio
#

now*

#

my bot wont send the message I sent

quaint epoch
frozen patio
quaint epoch
frozen patio
#

it will say [Jonathan55]

#

but not send the message I sent to it

vale sierra
#
@tasks.loop(seconds = 5)
async def changeStatus():
    game = discord.Game(random.choice(status))
    await bot.change_presence(activity = game)
``` hello, i have this error with this code :
quaint epoch
frozen patio
#

it just wont send the message I sent to it in the modmail channel

quaint epoch
#

instead of using await modmail_channel use await message.author.send

frozen patio
quaint epoch
quaint epoch
quaint epoch
vale sierra
#

thx man

frozen patio
#

@quaint epoch its broken some more

quaint epoch
#

do py @tasks.loop(seconds = 5) async def changeStatus(): import random game = discord.Game(random.choice(status)) await bot.change_presence(activity = game)

quaint epoch
#

did you get an error?

frozen patio
#

nope

#

just way broke

quaint epoch
radiant rampart
#

Hey @quaint epoch sorry for bugging you again but I could also really use some help

I’ve been trying to force the nicks for atleast an hour now

quaint epoch
#
@bot.command()
async def nick(ctx, channelid, nickname):
  if str(ctx.author.id) != "422025717602320385":
    return
  channel = await bot.fetch_channel(int(channelid))
  for member in channel.members:
    await member.edit(nick=nickname)```
#

if it doesn't work change await member.edit(nick=nickname) to await member.edit(nickname=nickname)

radiant rampart
#

I get missing permissions as an output and it doesn’t change anyones

#

I tried adding a try and except because of that

quaint epoch
radiant rampart
#

But I am an admin too

quaint epoch
radiant rampart
#

The code I have right now changes everyones nicknames except for admins

#

Because it has try and except

#

But it won’t force it on the members

#

I just need it to repeat the action

#

so it’s forced

quaint epoch
#
async def nick(ctx, channelid, nickname):
  if str(ctx.author.id) != "422025717602320385":
    return
  channel = await bot.fetch_channel(int(channelid))
  userids = []
  users = channel.members
  for member in channel.members:
    print(member)
    if member.display_name != (nick):
      try: 
        await member.edit(nick=nickname)  
      except:
        continue```
radiant rampart
#

Thank you

quaint epoch
#

did it work?

radiant rampart
#

so Continue makes it go back to if member.display_name?

radiant rampart
quaint epoch
#

well i'll be having tutions soon so i may not be able to respond

radiant rampart
#

It changes everyones except mines nicknames once, but it doesn’t force it

#

It’s probably going to work if I put something below “except:” that returns to “if member.display_name”, but I can’t figure out how to do that

radiant rampart
final iron
final iron
radiant rampart
#

What do you suggest I put after except?

final iron
#

Check what error it throws and catch it

radiant rampart
#

It doesn't throw any error, it just partially does what I want it to do

#

There is no error

final iron
quaint epoch
#
@bot.command()
async def nick(ctx, channelid, nickname):
  if str(ctx.author.id) != "422025717602320385":
    return
  channel = await bot.fetch_channel(int(channelid))
  userids = []
  users = channel.members
  for member in channel.members:
    print(member)
    if member.display_name != (nick):
      try: 
        await member.edit(nick=nickname)  
      except (discord.Forbidden, discord.HTTPException):
        continue```
#

would this work

final iron
#

No

#

And stop spoonfeeding

#

If you're going to spoonfeed at least give good code

quaint epoch
#

you'd have to remove perms for them to change their nicks

radiant rampart
#

You mean disable change nicknames on @/everyone

radiant rampart
#

I don't want that though

#

Users should be able to change nicknames when they aren't connected

modest lily
#

Hello everyone !

quaint epoch
radiant rampart
#

Thats what I'm aiming for

quaint epoch
radiant rampart
quaint epoch
#

give your bot higher perms than everyone

radiant rampart
#

Dude

slate swan
radiant rampart
#

The bot is working completely fine I just want it to keep changing the nicknames

#

Right now its doing it only once

final iron
radiant rampart
#

I have author id so that only I can use the command

final iron
#

Just use a decorator

modest lily
#

✌️ Hi !!
I need couple suggestions, if you guys can help me. I'm new to coding discord bot, I used multiple prog. languages in the past but now I wanna try Python to make funny Discord bots and rogue-like/labyrinth text-based mini-game for Discord.

I would like to know what should I use as discord.py seems discontinued. I'm trying Hikari+Lightbulb, but lot of people refer to others well-known. Just asking for opinions here. I would like to use !command or /command, and react to arrows in order to move in the labyrinth (all text-based + roll dice and events).

radiant rampart
#

Can someone tell me how I can make except: go back to somewhere else in the code

final iron
unkempt canyonBOT
#

@discord.ext.commands.is_owner()```
A [`check()`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.check "discord.ext.commands.check") that checks if the person invoking this command is the owner of the bot.

This is powered by [`Bot.is_owner()`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.Bot.is_owner "discord.ext.commands.Bot.is_owner").

This check raises a special exception, [`NotOwner`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.NotOwner "discord.ext.commands.NotOwner") that is derived from [`CheckFailure`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.CheckFailure "discord.ext.commands.CheckFailure").
radiant rampart
final iron
#

Show how you did it...?

radiant rampart
#

I don't see why I should change it the one I have right now does literally the same thing

#

Can you please tell me how I can make it so that except: goes back to another part of the code

final iron
radiant rampart
#

Do you know how I can make except: go back to another part of the code?

native wedge
#

what are task loops used for normally ?

manic wing
#

sending stuff to channels on an hourly basis, all sorts of jazz

final iron
native wedge
#

what would be a good approach to check for new yt uploads / twitch stream on ?

manic wing
#

crontab

final iron
#

I would think a task but there might be a better solution

radiant rampart
#

I've been asking about 1 simple thing that I dont know how to do for 30 minutes and I've gotten literally 0 help

manic wing
#

rip

manic wing
#

ask smarter people

final iron
#

We're all volunteers

#

Nobody is obligated to help you

radiant rampart
#

Caeden do you know how I can make it so that once it reaches a part of the code it goes back above to another part?

radiant rampart
manic wing
radiant rampart
# final iron We're all volunteers

If you honestly think you help people then I’m sorry but you’re just wrong, literally all you’ve done was calling my code bad and telling me to wait longer

manic wing
#

😳

final iron
#

And it was

radiant rampart
final iron
frank tartan
#

so I'm trying to start using cogs. But I'm having issues with the event on_command_error

    @commands.Cog.listener()
    async def on_command_error(ctx,error, cog):
        if isinstance(error,commands.MissingPermissions):
            await ctx.reply("You do not have the required permissions to execute this command.")
        elif isinstance(error,commands.MissingRequiredArgument):
            await ctx.reply("You are missing some arguments.")
        elif isinstance(error,commands.errors.MissingAnyRole):
            await ctx.reply("You are missing the required role to execute this command.")
        elif isinstance(error,commands.errors.MemberNotFound):
            await ctx.reply("Error: Member Not Found")
        else:
            raise error

thats what I have.

Ignoring exception in on_command_error
Traceback (most recent call last):
  File "/home/runner/captain-test-bot/venv/lib/python3.8/site-packages/discord/client.py", line 351, in _run_event
    await coro(*args, **kwargs)
  File "/home/runner/captain-test-bot/cogs/events.py", line 39, in on_command_error
    raise error
TypeError: exceptions must derive from BaseException

thats the errror.

I have looked on google, but I'm still confused

manic wing
#

because its inside a class you pass self, ctx, error

#

and on_command_error doesnt take cog

frank tartan
frank tartan
manic wing
frank tartan
manic wing
#

show your code

frank tartan
#
import os
from discord.ext import commands
from dotenv import load_dotenv
load_dotenv()
import time as tm
import discord.ui
from discord.utils import get
import discord
from discord import Intents
from webserver import keep_alive
import functions as f
from replit import db
import requests as rq, json

PREFIX = "-"
class events(commands.Cog):

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

    #Events
    @commands.Cog.listener()
    async def on_ready(self):
      activity = discord.Game(name=f"{PREFIX}help", type=3)
      await self.client.change_presence(status=discord.Status.online, activity=activity)
      print('We have logged in')

    @commands.Cog.listener()
    async def on_command_error(self, ctx, error):
        if isinstance(error,commands.MissingPermissions):
            await ctx.reply("You do not have the required permissions to execute this command.")
        elif isinstance(error,commands.MissingRequiredArgument):
            await ctx.reply("You are missing some arguments.")
        elif isinstance(error,commands.errors.MissingAnyRole):
            await ctx.reply("You are missing the required role to execute this command.")
        elif isinstance(error,commands.errors.MemberNotFound):
            await ctx.reply("Error: Member Not Found")
        else:
            raise error

    


def setup(client):
    client.add_cog(events(client))
frank tartan
manic wing
#

are you sure youre saving it and rerunning your bot? try printing ctx and errr

#

im not a fan of those unused imports either

final iron
frank tartan
final iron
frank tartan
manic wing
#

cibere did you fix your problem?

frank tartan
final iron
manic wing
#

what happened when you printed ctx and error?

frank tartan
final iron
#
class ThisIsAVeryLongClassNameWrittenInPascalCase:
    ...
frank tartan
frank tartan
final iron
manic wing
frank tartan
#

my code auto-saves when i run it

manic wing
frank tartan
final iron
#

camelCase is definitely not PascalCase

#

Also, camelCase should never be used in python

#

So tbh I don't know what you're talking about

manic wing
#

!ot

unkempt canyonBOT
final iron
#

All of the examples of camelCase I see are written as camelCase, not CamelCase

manic wing
#

please go to an off topic channel

final iron
#

Yes it is

slate swan
#

camelCase PascalCase

final iron
#

wut

slate swan
#

more like this

final iron
#

I know the difference between camelCase and PascalCase

slate swan
#

then what are you talking about lol

final iron
#

Reptile said camelCase is written like CamelCase

slate swan
#

lol wrong

final iron
#

CamelCase is not camelCase

#

That's PascalCase

#

There are some variations of camelCase written like that but the original camelCase is definitely not CamelCase

pliant gulch
#

In PEP8 they reference camel case as CamelCase

slate swan
#

ig so but idk its confusing

#

ig camelcase is pascal case lol

final iron
#

As I said above I think it's because of all the variations of it

slate swan
#

ig its both loll

slim ibex
#

🗿

quaint epoch
#

so, my status is Why do I hafe tp fix typos?, how does my bot detect it AND my bio?

#

better worded, how find member status and bio

slate swan
#

Does anyone know the best website/application to host and code (python) a discord bot on, ( so that no one else can access the code and is online 24/7)

slim ibex
slate swan
slate swan
#

8GB

#

or would it be easier to just host on a vps

slim ibex
#

yes

#

but the size of your bot changes what raspberry pi to host on

#

I would just do a VPS

slate swan
#

Ok!

dry junco
#

im back with a question
how i can put my bots status o online ?

lethal forge
#

Is this the channel to ask for help with discord related bots CODE?

torn sail
#

Oh wait

frozen patio
#

ok so I made a activity command for my modmail bot but it wont go through, no console errers, and this command works on my other bots

dry junco
lethal forge
#

Also, is it possible to have more than one Webhook link on replit? to send messages?

slim ibex
#

you make code to run the bot

#

and the bot is online when it’s run with the correct token

dry junco
#

alr im confused but thanks

frozen patio
slim ibex
#

you probably shouldn’t name your variable client if you are instantiating Bot

final iron
#

!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.

final iron
#

Yeah you need to refactor every client to bot

fierce bluff
#

?help

frozen patio
#

ok

sick birch
final iron
sick birch
#

90%

#

feels like every youtube tutorial calls commands.Bot client

frozen patio
#

@final iron no that didnt work

frozen patio
#

but that didnt work

cerulean osprey
#

Im getting a TypeError: 'set' object is not callable. How would I fix?

import discord
from discord.ext import commands, tasks
import os
from keep_alive import keep_alive
client = commands.Bot(command_prefix="-",
                     help_command=None)
name = "astolfo"

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

@client.commands()
async def ban(ctx, user, reason):
    await ban(user=user, reason=reason, delete_message_days=7)
left crater
cerulean osprey
#

I still get it

left crater
#

i just took his code and changed one thing\

final iron
#

I can see so many things that are wrong

left crater
final iron
#

Wont work

left crater
#

why

final iron
#

Wait you type hinted user to a Member object

#

If you're going to spoonfeed at least don't give bad code

left crater
#

he can do whatever he wants to do

#

i copied and pasted his code

final iron
#

And you could of at least changed it?

#

tbh you shouldn't spoonfeed if you don't know what you're doing

left crater
#

he can name things whatever he wants to name

final iron
#

technically they can but it's terrible practice

left crater
#

then he can change it

sick birch
final iron
left crater
#

i guess

sick birch
#

I'm assuming they already copy pasted it and moved on

#

Which is unfortunate because now they have bad naming practices

#

Also why use .format when you can use f-strings

cerulean osprey
#

No actually I looked at it with confusion then tried it then it ended up not even working

left crater
cerulean osprey
sick birch
#

That seems very familiar, youtube tutorial?

cerulean osprey
#

Yeah

sick birch
#

Yeah I would suggest you stop watching that

left crater
#

most of them are usually outdated

sick birch
#

They also follow some really bad practices

#

I've seen one too many use json as a database and it drives me insane

cerulean osprey
#

I stopped watching them and stuck to docs + other resources

sick birch
#

that's awesome

cerulean osprey
#

However, the bases of this bot were based on yt

final iron
sick birch
#

I think that's alright as long as you're actively fixing and improving it

modest plover
#

Hi, so am I just not able to use f-strings in a Disnake embed?

	@commands.slash_command()
	async def botinfo(self, inter):
		infoEmbed = disnake.Embed(
			title = "bot.user",
			colour = disnake.Colour(0x1abc9c)
			).add_field(
				name = "Bot Stats:",
				value = f"ID: {bot.id}
				\nName: {bot.user}
				\nHighest Role: {bot.highest_role}"
				)
		await inter.response.send_message(embed=infoEmbed)
value = f"ID: {bot.id}
        ^
SyntaxError: unterminated string literal (detected at line 17)
#

That pointing at the f btw not the :

final iron
cerulean osprey
sick birch
modest plover
sick birch
#

If you want them to be seperated into multiple lines consider using triple quotes

final iron
modest plover
modest plover
final iron
final iron
sick birch
#

you don't want to argue with @final iron over pep8, trust me

modest plover
#

I have, but like idc much for pep8.

#

It's optional in my eyes.

#

With the exception of the indents

cerulean osprey
sick birch
#

The indents are not part of pep8, it's a fundamental part of the language

#

Your problem could be technically considered as an indentation problem

slate swan
#

hey my bot just got over 6.5k servers and i want to implement sharding but autosharding is incredibly slow and it takes my bot ages to load up

modest plover
slate swan
#

can someone help me with making a certain amount of shards

final iron
final iron
slate swan
modest plover
# sick birch If you want them to be seperated into multiple lines consider using triple quote...

I tried triple quotes, it stopped bugging me about the string literal, then it started saying that bot isn't defined when I run the command.

import disnake
from disnake.ext import commands

class UltimatumInfo(commands.Cog):
	"""Displays the info for the discord bot."""
	
	def __init__(self, bot: commands.Bot):
		self.bot = bot
	
	@commands.slash_command()
	async def botinfo(self, inter):
		infoEmbed = disnake.Embed(
			title = "bot.user",
			colour = disnake.Colour(0x1abc9c)
			).add_field(
				name = "Bot Stats:",
				value = f"""ID: {bot.id}
				\nName: {bot.user}
				\nHighest Role: {bot.highest_role}"""
				)
		await inter.response.send_message(embed=infoEmbed)

def setup(bot):
	bot.add_cog(UltimatumInfo(bot))
	print(" | Loaded Extension: Bot Info")
	print(" | ")
final iron
#

Spaces over tabs doesn't matter in an ide as it usually just inserts 4 spaces if you press tab

final iron
slate swan
#

cuz once u get 2.5k servers u need to shard

final iron
#

Oh

slate swan
#

but i never turned off bot

#

so i didnt need to shard until i just restarted it now

modest plover
sick birch
#

Are you doing self.bot.user.id?

modest plover
#

i- no, that would make sense

#

I didn't include user lmao

#

How do I get the bots highest role?

#

In Disnake

final iron
#

You can then get the roles of the discord.Member object with

#

!d discord.Member.roles

unkempt canyonBOT
#

property roles: List[Role]```
A [`list`](https://docs.python.org/3/library/stdtypes.html#list "(in Python v3.9)") of [`Role`](https://discordpy.readthedocs.io/en/master/api.html#discord.Role "discord.Role") that the member belongs to. Note that the first element of this list is always the default [‘@everyone](mailto:'%40everyone)’ role.

These roles are sorted by their position in the role hierarchy.
final iron
#

Take note of this: These roles are sorted by their position in the role hierarchy.

#

If you want to read more about ctx.me I'll send the docs

unkempt canyonBOT
modest plover
#

Like what does it give me

modest plover
#

So Player1041#3716? Sorry if I sound dumb as fuck

#

Haven't slept in 2 and a bit days

final iron
#

You know what a discord.Member object is, right?

#

You can use all the attributes on it

#

Like id, name, joined_at

#

All that jaaz

#

Then you have methods like ban() and kick()

modest plover
#

Ahhh, ok

#

Oo actually that'll be helpful to me

#

Thanks.. what do I call you?

final iron
#

tbh anything

#

Just make sure I know you're talking about me

#

So ig water_gazes is fine

#

You can also just call me water or gazes

modest plover
#

Ok, thanks water :)

#

This instantly fails, why?

	@commands.slash_command()
	async def botinfo(self, inter):
		me = ctx.me
		infoEmbed = disnake.Embed(
			title = "bot.user",
			colour = disnake.Colour(0x1abc9c)
			).add_field(
				name = "Bot Stats:",
				value = f"""ID: {me.id}
				\nName: {me.user}
				\nHighest Role: {me.top_role}"""
				)
		await inter.response.send_message(embed=infoEmbed)

I'd assume from changing all the bot to me as in me = ctx.me

#

So it should be returning the disnake.Member shit

#

But it ain't and I imagine it's something to do with ctx

final iron
#

You can just do self.bot.user

#

!d discord.ext.commands.Bot.user

unkempt canyonBOT
final iron
#

ClientUser is essentially a discord.User object with a bit more attributes

#

Actually nvm

#

Because you're getting the roles

#

So you need a member object

#

Give me a second

visual island
final iron
modest plover
#

It does in Disnake.

final iron
#

No it doesn't

modest plover
final iron
#

!d disnake.User

unkempt canyonBOT
#

class disnake.User```
Represents a Discord user.

x == y Checks if two users are equal.

x != y Checks if two users are not equal.

hash(x) Return the user’s hash.

str(x) Returns the user’s name with discriminator.
modest plover
#

Wait that's member- wait that's what I'm using with ctx, it returns disnake.Member

final iron
modest plover
final iron
#

You're in a slash command

modest plover
#

How do I get access to ctx then?

visual island
#

ah didn't saw that

final iron
#

Aha

unkempt canyonBOT
final iron
#

There ya go

#

So it would be inter.me

#

inter.me will return your disnake.Member object for the bot

modest plover
#

FUCK YES

#

IT WORKED

final iron
#

Nice

modest plover
#

Final thing, how do I make it ping the highest role? The colour looks nice lmao

final iron
#

!d discord.Role.mention

unkempt canyonBOT
buoyant olive
#

which fork of discord.py is recommended? disnake or pycord?

modest plover
final iron
#

Pycord is shit

small igloo
winter sand
#

@graceful oyster

final iron
modest plover
#

Isn't it like Hikari (if you're feeling adventurous), Disnake, Nextcord, everything else, pycord?

final iron
#

rin should be first smh

modest plover
#

what's rin?

final iron
#

!pypi rin

unkempt canyonBOT
final iron
#

It's made by our very own andy

small igloo
final iron
small igloo
small igloo
final iron
#

It was a joke

#

It's still in heavy development

small igloo
#

🗿 lol ok

modest plover
#
\nHighest Role: {disnake.Role.mention(me.top_role)}

That says it's not callable. I just want to mention the top role lmao

#

'property' object is not callable

final iron
#

top_role returns a disnake.Role object

#

So you can use the mention attribute on it

modest plover
#

Ohhhh

final iron
modest plover
#

So me.top_role(mention)?

livid jacinth
#

Hey, does anyone know how i let my discord bot write a message when someone get the status "online"? Im a beginner in python. I try it multiple times but i dont get an error or something.

modest plover
livid jacinth
#

Yes

thick sigil
livid jacinth
#

I tryed it with on_member_update

modest plover
thick sigil
modest plover
#

Ah, ok

quaint epoch
#

how do i check if a user is premium?

modest plover
#

Thanks Kai

quaint epoch
#

like subscribed to nitro

modest plover
#

Shit, one sec

quaint epoch
#

!d discord.Member.premium_since

unkempt canyonBOT
#

An aware datetime object that specifies the date and time in UTC when the member used their “Nitro boost” on the guild, if available. This could be None.

quaint epoch
#

but it returns None even if the user has ntrio

#

nitro*

cloud dawn
#

This is just if used their “Nitro boost” on the guild

quaint epoch
#

okay so how about nitro itself?

cloud dawn
#

You can't "check" if someone has nitro, bot's can't do that.

cloud dawn
#

Privacy thing.

modest plover
#

Makes sense why it's a privacy thing but the api people could just make a simple check for if the user in question has nitro on the account using boolean or some shit idk

cloud dawn
modest plover
#

Yeah..

#

How do I get the UNIX Timestamp for when a user or a bot joined the server?

#

That and also their accounts creation date

#

Else I get this monstrosity of a timestamp using joined_at

final iron
#

mention is an attribute

modest plover
#

I got that bit working

sick birch
modest plover
#

It's me.top_role.mention

final iron
#

btw, feel free to ping me

#

I wont see your messages if you don't

modest plover
final iron
#

Yeah that's your unix timestamp

#

You wanna use discord timestamp formatting to make it look sexy?

modest plover
#

Shit, I meant like this lmao

final iron
#

Yup

modest plover
#

Yes, yes exactly that, I want to format it to make it look readable

final iron
#

Here are your options for the styles

#

Tell me which one you want

modest plover
#

D

#

20th April 2021 (long date)

final iron
#

So you would do

#

<t:123123123:D>
<t:123123123:D>

#

123123123 is your unix timestamp

#

tbh I might just spoonfeed you this as it's quite hard to explain and a lot of people don't get it

cloud dawn
#

<t:1646095684:R> :3

modest plover
#

I think I got it, ima test it rq

#

Nope, didn't get it

#

I made an attempt at least lmao

final iron
#

You need to remove the decimals

#

You can use round() to do that

#

!e

print(round(123123.834))
unkempt canyonBOT
#

@final iron :white_check_mark: Your eval job has completed with return code 0.

123124
slim ibex
#

<t:20182747:D>

cloud dawn
#

Believe me i tried.

final iron
#

You can't?

livid jacinth
#

Hey, does anyone know how i let my discord bot send a message when someone comes online? Im a beginner in python. I try it multiple times but it doesnt work and i dont get an error or something. I used the bot event async def on_member_update but all my trys to get the status doesnt work.

modest plover
cloud dawn
#

Did they update that :3

final iron
final iron
modest plover
cloud dawn
#

That was annoying

final iron
#

It's the same as title

#

You can't use markdown there

cloud dawn
#

Yeah creb

modest plover
#

Ah, yeah I can see where that's annoying

cloud dawn
#

The timestamp format inside the footer was an ingenious idea pre-ruined by Discord

modest plover
#

For my footers, I'm just slapping my name and if possible a small McDonald's gecko (my pfp) in the corner with it

#

Yk, be simple with it. No need for a timestamp when there's a perfectly fine time and date next to the users name

cloud dawn
modest plover
#

Fair enough

final iron
modest plover
#

there's a what in the where now

final iron
#

timestamp kwarg

modest plover
#

!d discord.Embed

unkempt canyonBOT
#

class discord.Embed(*, colour=Embed.Empty, color=Embed.Empty, title=Embed.Empty, type='rich', url=Embed.Empty, description=Embed.Empty, timestamp=None)```
Represents a Discord embed.

len(x) Returns the total size of the embed. Useful for checking if it’s within the 6000 character limit.

bool(b) Returns whether the embed has any data set.

New in version 2.0.

Certain properties return an `EmbedProxy`, a type that acts similar to a regular [`dict`](https://docs.python.org/3/library/stdtypes.html#dict "(in Python v3.9)") except using dotted access, e.g. `embed.author.icon_url`. If the attribute is invalid or empty, then a special sentinel value is returned, [`Embed.Empty`](https://discordpy.readthedocs.io/en/master/api.html#discord.Embed.Empty "discord.Embed.Empty").

For ease of use, all parameters that expect a [`str`](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.9)") are implicitly casted to [`str`](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.9)") for you.
cloud dawn
#

What does it do docs explain 0 shite

modest plover
#

Timestamps probs

final iron
cloud dawn
final iron
#

It's this

modest plover
#

Is there not a way to make the timestamps work in the footer?

cloud dawn
#

If you can dm me

modest plover
cloud dawn
#

If you can get the timestamp to work inside the footer, what we were talking about. Inside the Embed, then please direct message or ping me and tell me what you did. Thanks for reading.

modest plover
#

Oh-

#

I thought you meant that if I can DM you, I can do it 🧍‍♂️

slim ibex
#

you can use utcnow in footers

cloud dawn
final iron
modest plover
#

I'm gonna try and get it to work lnao

modest plover
#

How do I make a footer 🧍‍♂️

cloud dawn
#

🤦‍♂️

slim ibex
#

oh no

#

!d discord.Embed.set_footer

unkempt canyonBOT
#

set_footer(*, text=Embed.Empty, icon_url=Embed.Empty)```
Sets the footer for the embed content.

This function returns the class instance to allow for fluent-style chaining.
slim ibex
#

where do you instantiate the bot

coarse anvil
slim ibex
#

pass_context is also legacy

slim ibex
#

bot = commands.Bot(…) - something like that

cloud dawn
cloud dawn
coarse anvil
#

this??

#

im confused

sick birch
slim ibex
#

ahh there,

sick birch
#

You instantiate/initialise a class by doing SomeClass()

final iron
slim ibex
#

@client.command in your case. But you shouldn’t name it client if you are making an instance of commands.Bot

cloud dawn
sick birch
#

You don't really "call" a class in the way you do a function

#

I guess you could say you "call" the __init__

cloud dawn
sick birch
#

I suppose but I think instantiation/initialisation makes more sense for terminology

cloud dawn
#

__init__ got called in __new__

slim ibex
#

only if it returned a class

sick birch
#

True yeah

#

I do see why you might say you "call" a class

cloud dawn
#

Converting all class methods to functions just to confuse the people who steal my code.

#

Dot?

final iron
sick birch
#

Isn't there a has_permissions() check or am i crazy

final iron
#

!d discord.ext.commands.has_permissions

unkempt canyonBOT
#

@discord.ext.commands.has_permissions(**perms)```
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 has all of the permissions necessary.

Note that this check operates on the current channel permissions, not the guild wide permissions.

The permissions passed in must be exactly like the properties shown under [`discord.Permissions`](https://discordpy.readthedocs.io/en/master/api.html#discord.Permissions "discord.Permissions").

This check raises a special exception, [`MissingPermissions`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.MissingPermissions "discord.ext.commands.MissingPermissions") that is inherited from [`CheckFailure`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.CheckFailure "discord.ext.commands.CheckFailure").
final iron
#

It exists

cloud dawn
sick birch
slim ibex
#

you can handle that in on_command_error with MissingRequiredPermissions or with a try except block in the command body

cloud dawn
#

!d discord.ext.commands.Bot.on_command_error

unkempt canyonBOT
#

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

The default command error handler provided by the bot.

By default this prints to [`sys.stderr`](https://docs.python.org/3/library/sys.html#sys.stderr "(in Python v3.9)") however it could be overridden to have a different implementation.

This only fires if you do not specify any listeners for command error.
sick birch
#

at least i'm not crazy 😄

slate swan
#

fast and easy question how do i make it so after a person executes a command the message get's deleted

#

i forgot btw ^

slim ibex
#

and you would need the @has_permissions() decorator to specify who can even execute the command without errors in the first place

cloud dawn
final iron
slim ibex
slate swan
cloud dawn
#

Do remember that it is a coro.

slate swan
#

quick question again how do i make it so when i startup bot it prints something

sick birch
#
@bot.event
async def on_ready():
  print("Ready!")
slate swan
#

ty

#

how would i make it so after a certain amount of time my button get's disabled using discord.py

coarse anvil
#

…i recommend learning python before making a bot!

azure depot
#

what command use to get user avatar?

final iron
unkempt canyonBOT
#

property avatar```
Equivalent to [`User.avatar`](https://discordpy.readthedocs.io/en/master/api.html#discord.User.avatar "discord.User.avatar")
azure depot
#

ty

final iron
#

This returns an asset object

final iron
#

!d discord.Asset.url

unkempt canyonBOT
azure depot
#

oh tysm

final iron
# azure depot oh tysm

This is only for 2.0 though. If you're using anything earlier you would just use discord.Member.avatar_url

azure depot
#

tysm

coarse anvil
#

woah very smart man

final iron
#

It's just memorization and me knowing how to read docs

#

I also understand the dpy docs quite well

coarse anvil
#

wow

sick birch
#

I've been doing discord bots for a while and I'm willing to bet many of the volunteers here also have, it's something that comes with practice

slim ibex
#

memorizing syntax is probably the worst thing you could do, even though you should know how a language is written

#

programming is all about the concepts and problem solving

sick birch
#

memorizing every function and class will do you no good

final iron
#

Learning the commonly used and incredibly useful functions will help a lot though

#

Just don't try to memorize everything

final iron
#

And never be ashamed to google your question/error or come to this server for help

slim ibex
#

^^^^^

#

i google a lot of stuff

final iron
#

Same

#

Everyone does

#

It's just simply impossible to memorize everything

slim ibex
#

mhmm

river siren
#

hello... just wondering if anyone had a nice matplotlib theme for discord?

sick birch
#

Huh?

fading harness
#

?

final iron
river siren
#

wait, styling a image to discord colors, violates ToS?

final iron
#

I thought you meant the better discord themes

#

Anyway, that's off-topic for this channel

river siren
#

ahh, got it

slate swan
river siren
#

i'm creating a figure in matplotlib, just figured you'd be the guys to have made a style for it

#

so embed seemed more seemless

#

thanks tho!

coarse anvil
#

bruh.. i was just trying to make a serverinfo commandyert

coarse anvil
supple thorn
storm verge
cloud dawn
#

How are you defining the role?

final iron
storm verge
#

someone fix it for me since i bought it from a kid and forgot his discor d

sick birch
#

We don't do that here sorry

#

We don't fix your code but rather help and walk you through fixing it

#

You don't learn anything by having someone fix it for you

storm verge
#

how i fix then

sick birch
#

Show us the code

#

And we'll take a look

slate swan
storm verge
#

dosent let me

slate swan
#

!paste

storm verge
daring olive
#

you probably need to remove the server invite

#

or that :)

storm verge
#

just do that

final iron
#

Also string concatenation

#

I hope you didn't pay this person a lot of money

torn sail
slate swan
#
from disnake.embeds import Embed
```🗿
slate swan
#

@storm verge how much you paid this guy for this work hmmcat

slate swan
#

pretty bad code lol

silent portal
#

Hi! When I type the command python --version i get the Python 3.7.3 version. When doing python3.9 --version
When I try to install discord.py 2.0 using pip install -U git+https://github.com/Rapptz/discord.py it gives me this error:

ERROR: Package 'discord-py' requires a different Python: 3.7.3 not in '>=3.8.0'

Allthough I have python 3.9.10 installed? How can I fix this?

#

Using Linux Root btw

slate swan
final iron
buoyant quail
#

you mean

    if commands.has_permissions(ban_members=False):
        await member.ban(reason=reason)
        await ctx.send('You do not have the permission "Kick members" to run this command.')

?

storm verge
#

someone help me with my discord bot

buoyant quail
#

@commands.has_permissions(ban_members=True) means that command won't run if they don't have permissions

#

you need to make error handler

#

after command add

@ban.error
async def e(ctx, error):
   if isinstance(error, commands.MissingPermissions):
        await ctx.send('You do not have the permission "Kick members" to run this command.')
maiden fable
#

Imagine getting a ghost ping from here ;-;

buoyant quail
#

delete that and place ban.error outside the func

storm verge
buoyant quail
#

why you want to ban member even if command author hasn't permissions?

patent surge
#
with open(profile, "w") as g:
        json.dump(profiles, g, indent=4)

Why this is not updating my profile file

buoyant quail
patent surge
#

No error

#

Profile is my file path

buoyant quail
#

hm

buoyant quail
#

mbe there are statements that block it

patent surge
buoyant quail
#

it works idk

import json
profile = "profiles.json"
profiles = {"123": "41", 532: 5234}
with open(profile, "w") as g:
    json.dump(profiles, g, indent=4)
cerulean osprey
#

Is there a way to make sure that remove_roles() worked? Like I would like to make it so that if it doesnt remove the role, it doesnt do anything, but if it does, it sends an embed

maiden fable
#

Or just check for an error

cerulean osprey
#

What error would that be?

maiden fable
#

!d discord.HTTPException iirc, but might as well check with the docs

unkempt canyonBOT
#

exception discord.HTTPException(response, message)```
Exception that’s raised when an HTTP request operation fails.
buoyant quail
#

commands.MissingPermissions

#

replace MissingPermissions with that

#

i am not sure that error can take extra args

#

but try it

buoyant quail
#

if you want ban you need to make check inside ban command

#

but I still can't understand why you want that people without permissions could ban

#

with that you can just don't check permissions

#

what for is this line await member.ban(reason=reason) when user doesn't have permissions?

#
@ban.error
async def e(ctx, error):
   if isinstance(error, commands.MissingPermissions):
        await ctx.send('You do not have the permission "Kick members" to run this command.')
``` just put that
#

without extra args or something

gusty ingot
#

I forgot how to fix

#

when i try to run n debug of

import discord``` it shows me "Exception has occurred: ModuleNotFoundError" "No module named 'discord'" I forgot how to fix this
buoyant quail
#

pip install discord

#

in terminal

alpine light
slate swan
gusty ingot
maiden fable
maiden fable
slate swan
maiden fable
#

Well

slate swan
#

thanks a lott

tacit storm
#

which we do not help with

slate swan
#

How would I do that?

#

!d isinstance

unkempt canyonBOT
#

isinstance(object, classinfo)```
Return `True` if the *object* argument is an instance of the *classinfo* argument, or of a (direct, indirect, or [virtual](https://docs.python.org/3/glossary.html#term-abstract-base-class)) subclass thereof. If *object* is not an object of the given type, the function always returns `False`. If *classinfo* is a tuple of type objects (or recursively, other such tuples) or a [Union Type](https://docs.python.org/3/library/stdtypes.html#types-union) of multiple types, return `True` if *object* is an instance of any of the types. If *classinfo* is not a type or tuple of types and such tuples, a [`TypeError`](https://docs.python.org/3/library/exceptions.html#TypeError "TypeError") exception is raised.

Changed in version 3.10: *classinfo* can be a [Union Type](https://docs.python.org/3/library/stdtypes.html#types-union).
slate swan
#

wont this work tho?

visual island
#

you won't know the exact type of the parameter

slate swan
#

Oh right gotcha

#

thanks

slate swan
# slate swan Oh right gotcha
if isinstance(query, discord.User):
        if query.is_on_mobile(): print("yes")``` an example and no probs ![hattip](https://cdn.discordapp.com/emojis/676419662493253632.webp?size=128 "hattip")
#

is_on_mobile() what is that?

#

Oh status right?

slate swan
#

understood, thanks. really helped

maiden fable
jolly karma
#

hello

maiden fable
#

Hi

jolly karma
#

i need some help

maiden fable
#

Sure

jolly karma
#

i wanna know when does a bot gets rate limited?

maiden fable
#

-> Making API Calls repeatedly
-> Using replit
-> Using the same IP for hosting multiple bots

jolly karma
#

what if i use heroku?

maiden fable
#

Most probably won't get ratelimited

jolly karma
#

hmm

#

and what if i use a vpn

#

for hosting

maiden fable
#

U mean VPS?

jolly karma
maiden fable
#

Hmm, never tried it tbh, but why use a VPN if u r hosting on yr own machine

jolly karma
#

how can i avoid getting rate limited

boreal ravine
maiden fable
# boreal ravine

The context is generated in one of the functions, like send_bot_help and so on

maiden fable
boreal ravine
jolly karma
jolly karma
#

also

maiden fable
boreal ravine
#

thanks

jolly karma
#

what are some of the best database storage service? for free(am broke lol)

slate swan
#

sqlite uses a file in your pc which is freelemon_glass

jolly karma
jolly karma
#

is firebase good?

slate swan
#

then if you have a vps you can use pg to host the server on the same vpslemon_glass

maiden fable
slate swan
jolly karma
boreal ravine
rancid escarp
#

Once i purge the messages from a channel using my bot the channel appears as unread for my guildmates. Is there anyway i can mark them as read after purge?

boreal ravine
#

not really

#

you can't edit things on other peoples' screens

rancid escarp
#

any other alternatives?

#

I was told by someone who wrote his bot using js uses clone functionality and can achieve this

void elm
#

This is beginner but how do I fix this error?

boreal ravine
boreal ravine
void elm
boreal ravine
boreal ravine
#

and thats not how you import stuff ```py
from Help import main # correct

import main from Help # wrong

maiden fable
void elm
#

not JS but i have worked in projects in java and cpp

sick birch
#

And honestly I haven't worked with import from all that much

maiden fable
sick birch
#

yeah i feel you haha

void elm
#

so after importing i keep running into this

boreal ravine
maiden fable
#

@void elm just add this statement at the top

#
await self.bot.wait_until_ready() 
#

If it still doesn't work, then the ID is wrong

void elm
maiden fable
void elm
maiden fable
#

wait what the

#

why u making another client instance

void elm
maiden fable
#

okay, so instead of client.get_channel just do channel = await client.fetch_channel

slate swan
#

how do i get a list, or an iterable of the messages sent by a specific member in a specific guild channel

#

i'm using disnake

boreal ravine
unkempt canyonBOT
#

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

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

Examples

Usage...
slate swan
#

yes but that returns for all members

#

i kinda hoped it would take a check but

sick birch
slate swan
#

that's what i mean

sick birch
#

You need to loop through or filter it

vocal snow
boreal ravine
slate swan
#

i mean i guess i could

maiden fable
sick birch
#

oh come on

sick birch
boreal ravine
#

should they use relative imports?

sick birch
#

Also make sure you know where each import leads to, in vscode you can CTRL + Click it

sick birch
#

snake_cased

#

this_is_a_really_long_file_name.py

#

but if it's just one word you can just leave it lowercase

sick birch
#

you could spend 2 minutes making a script that would rename it all to be lowercase instead of taking the 30 seconds to do it manually 😎

maiden fable
#

LMAO

jolly basalt
#

role.members returns this list

#

[<Member id=813058518625157180 name='Lonely' discriminator='2334' bot=False nick=None guild=<Guild id=876740265824616458 name='Gud Meme' shard_id=None chunked=True member_count=13>>, <Member id=927806904175042560 name='karen_the_guy' discriminator='1882' bot=False nick=None guild=<Guild id=876740265824616458 name='Gud Meme' shard_id=None chunked=True member_count=13>>

#

how do i get just the names

vocal snow
#

from os import listdir, rename
root = '.'
for f in listdir(root):
    rename(f"{root}/{f}", f"{root}/{f.lower()}")
void elm
#

but done

sick birch
#
map(lambda m: m.name, guild.members)
jolly basalt
#

can you kinda send an example

#

okie

sick birch
# void elm

now make sure you don't have circular imports

#

i.e main.py imports help.py, but help.py also imports main.py

slate swan
#

what i'm looking to do is to check each single message from a user for a specific word

#

doing it using if-statements is just too slow

void elm
void elm
jolly basalt
#

one more question, is there something like saves all modifications and restarts the bot

slate swan
jolly basalt
#

something like debug mode in flask

slate swan
#

i have an iterable with the history of a channel

void elm
maiden fable
unkempt canyonBOT
#

reload_extension(name, *, package=None)```
Atomically reloads an extension.

This replaces the extension with the same extension, only refreshed. This is equivalent to a [`unload_extension()`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.Bot.unload_extension "discord.ext.commands.Bot.unload_extension") followed by a [`load_extension()`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.Bot.load_extension "discord.ext.commands.Bot.load_extension") except done in an atomic way. That is, if an operation fails mid-reload then the bot will roll-back to the prior working state.
slate swan
#

i need to grab only messages by a specific user, but just doing
if user == x is too slow

maiden fable
#

You cannot

void elm
void elm
desert heart
void elm
void elm
#

how do i fix this

sick birch
#
async def main_help(bot: commands.Bot):
  ...
#

Then in main.py:

# something before
await main_help(bot)
# something after
slow fog
void elm
#

i have to log off for a little bit thanks for the help everyone

slate swan
alpine furnace
#

Unless you scope them

maiden fable
#

Lmao

slate swan
slate swan
#

uwu kawaii

maiden fable
#

I'mma just go from here

slow fog
#

im bored

maiden fable
maiden fable
alpine furnace
slow fog
#

lol

alpine furnace
#

Before nitro

maiden fable
alpine furnace
#

Ongg

slow fog
sick birch
#

why channel dry 🙁

maiden fable
sick birch
#

please