#discord-bots

1 messages Β· Page 1028 of 1

unkempt canyonBOT
#

property bot```
Equivalent to [`User.bot`](https://discordpy.readthedocs.io/en/master/api.html#discord.User.bot "discord.User.bot")
slate swan
#

@spring flax

#

how do i make button when person press it to make private channel and there person can write his report

spring flax
slate swan
#

k

slate swan
unkempt canyonBOT
#

await create_text_channel(name, *, reason=None, category=None, position=..., topic=..., slowmode_delay=..., nsfw=..., overwrites=..., default_auto_archive_duration=...)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).

Creates a [`TextChannel`](https://discordpy.readthedocs.io/en/master/api.html#discord.TextChannel "discord.TextChannel") for the guild.

Note that you need the [`manage_channels`](https://discordpy.readthedocs.io/en/master/api.html#discord.Permissions.manage_channels "discord.Permissions.manage_channels") permission
to create the channel...
slate swan
#

You can pass overwrites kwarg as a mapping of role: PermissionOverwrite

#

Hm hold on

#

!d discord.PermissionOverwrite

unkempt canyonBOT
#

class discord.PermissionOverwrite(**kwargs)```
A type that is used to represent a channel specific permission.

Unlike a regular [`Permissions`](https://discordpy.readthedocs.io/en/master/api.html#discord.Permissions "discord.Permissions"), the default value of a
permission is equivalent to `None` and not `False`. Setting
a value to `False` is **explicitly** denying that permission,
while setting a value to `True` is **explicitly** allowing
that permission...
slate swan
#

thx

#

Examples are provided on the docs too fyi

quaint epoch
#

.topic

lament depotBOT
#
**What unique features does your bot contain, if any?**

Suggest more topics here!

quaint epoch
#

bad bot

slate swan
#

it can randomly go offline and come back online automatically

quaint epoch
# lament depot

when i run >close_bot code is ```py
@commands.command(description="Terminates the bot's connection to the API", brief="Terminates the bot's connection to the API")
@commands.is_owner()
async def close_bot(self, ctx):
await bot.close()

#

it goes offline then online again

slate swan
#

how to my bot send user name of member

#

Can i run two bots on one token?

#

no

#

why

#

cuz its diffrent token

#

No it's the same token

#

It's working fine for me

#

I have a music bot and an economy bot using the same token but different prefix

#

do u know how to my bot send nickname of a member when he type cmd?

#

like ctx.send(f"user.name.member")?

#

and how to make slash command?

#

like my prefix is "." but i want a slash command like /

stray carbon
slate swan
#

thx

#

but it need to send nickname no username

placid skiff
#

!d discord.Member.nick

unkempt canyonBOT
placid skiff
#

i dunno if it returns the user username or None if the member nick is not set

#

Read the source and it should return None

unkempt canyonBOT
#

disnake/member.py line 359

self.nick: Optional[str] = data.get("nick")```
spring flax
unkempt canyonBOT
#

property display_name```
Returns the user’s display name.

For regular users this is just their username, but
if they have a guild specific nickname then that
is returned instead.
slate swan
#

can anyone help

#

i just made a bot and i made few comamnds and the bot doesn't respond and i'm sure it is online and everything is alright

spring flax
slate swan
spring flax
#

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

dull terrace
#

how would you format this to make it look cleaner and take up less space froggy_chill

#

it's currently cutting off the very top on mobiles because it's so much text

paper sluice
#

spread it out on two pages

#

!pip lyricsgenius

unkempt canyonBOT
slate swan
#

api key*

dull terrace
placid skiff
#

you can add a field with an empty character in it (" " will not work, you need some unicode character)

slate swan
slate swan
#

how to my bot send message who sended command like nick and ctx.author.member.nick?

dull terrace
slate swan
placid skiff
slate swan
#

command .Nickname and bot send his nickname

placid skiff
#

!d discord.Member.display_name

slate swan
#

await ctx.send("ctx.author.member.nick")

unkempt canyonBOT
#

property display_name```
Returns the user’s display name.

For regular users this is just their username, but
if they have a guild specific nickname then that
is returned instead.
slate swan
slate swan
slate swan
slate swan
#

thx

placid skiff
#

.....

#

No comment

slate swan
#

lmao

pulsar bay
slate swan
#

isn't work

slate swan
pulsar bay
#

@slate swan what do u need again

slate swan
#

I-
Blvck will help you

placid skiff
#

BRUH

#

Ok show the code

slate swan
placid skiff
#

HAHAHAHAHA
LMFAO

pulsar bay
#

πŸ’€ brhh

pulsar bay
placid skiff
#

!e

var = "aeiou"
print(f"var")
print(f"{var}")
unkempt canyonBOT
#

@placid skiff :white_check_mark: Your eval job has completed with return code 0.

001 | var
002 | aeiou
pulsar bay
#

idk if it changed or not i would have to check but

slate swan
placid skiff
#

and that's it

pulsar bay
#

put a { and } around ctx.author.display_name

#

so its {ctx.author.display_name}

slate swan
#

isn't ctx.send("ctx.author.display_name")?

pulsar bay
#

what

placid skiff
#

she's completely ignoring me D_D

pulsar bay
#

😐

placid skiff
pulsar bay
#

change your code to

await ctx.send(β€œ{ctx.author.display_name}”)
pliant gulch
#

You can just directly pass ctx.author.display_name since it's already a str

#

There is no need for that f-string

pulsar bay
#

forgot it

slate swan
#

?

#

***```py
await ctx.send(f"{ctx.author.display_name}")

#

thanks for now

pulsar bay
#

yh

placid skiff
#

See @slate swan ? that's why I told that you condemned us

slate swan
pulsar bay
#

yo

#

okay im out

slate swan
#

they are both different sign

placid skiff
#

This is a comedy

pulsar bay
#

ur using repl i see why its doing that

pulsar bay
#

remove it and reput β€œ

slate swan
#

^

#

simply send it without using a f string await ctx.send(ctx.author.display_name)

#

i doed that

#

doed

#

what happened then?

#

it sended ctx.author.display_name

#

lmao

#

πŸ’€

slate swan
#

again, you don't need to use " " copy paste what i sent.

#

now works @pulsar bay thanks

#

await ctx.send(f”ur display name is {ctx.author.display_name}”)

#

i reputed it

#

nice

#

''"

pulsar bay
#

two different symbols

slate swan
#

do u know how do i put gif in message like



(gif)```
#

;-;

placid skiff
slate swan
#

what about you?

#

lol

#

no isn't

slate swan
#

no

placid skiff
slate swan
#

!d discord.ui.button

#

who?

placid skiff
#

lol

slate swan
#

!resources will help @slate swan for learning python

unkempt canyonBOT
#
Resources

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

slate swan
#

@slate swan how to make like .nick @slate swan and bot sends ur nickname

#

your not mine

placid skiff
slate swan
#

!d discord.Member.display_name

unkempt canyonBOT
#

property display_name```
Returns the user’s display name.

For regular users this is just their username, but
if they have a guild specific nickname then that
is returned instead.
placid skiff
#

is a chick dude

#

i think

slate swan
#

i just gived him whole code

slate swan
#

k

#

:D

#

so no ctx?

#

no ctx

#

right?

#

k

#

await ctx.send(f"{discord.Member.display_name}")

#

yes

#

?

#

k

#

replace discord.Member with ur member var

#

bruh my bot don't wanna to run

slate swan
#

it will work fine

slate swan
#

no i delted command i will back command when i fix this

slate swan
#

deleted*

#

show ur whole code

#

Congo,you just got ratelimited.

#

ikr xD

#

type kill 1 in shell

placid skiff
slate swan
#

but token

#

yes

#

dm @slate swan cuz token

#

bruh lmao

#

for 15 mins-_-

#

he just dmed me the token πŸ’€

slate swan
#

yeah

#

i sended u token

slate swan
#

πŸ’€

#

fake of other bot

slate swan
#

ik

#

i think to u are good person πŸ‘

#

dont think that πŸ’€

#

lol

#

OKAY

#

so can u help me?

placid skiff
#

We could really make a sitcom about this D_D

slate swan
#

@slate swan

placid skiff
#

uhm.. is that legal? D_D

slate swan
#

this?

stiff gorge
#
    raise errors.ExtensionFailed(key, e) from e
discord.ext.commands.errors.ExtensionFailed: Extension 'cogs.covid' raised an error: ImportError: cannot import name 'time_calc' from 'utils' (/home/runner/mv/venv/lib/python3.8/site-packages/utils/__init__.py)

why am i not able to load ?

slate swan
#

copy ur code and paste in other project

stiff gorge
#

?

slate swan
#

nvm

#

sparky im using 3.10.4 version

#

instaling*

#

installing*

#

how do i make button?

slate swan
slate swan
#

how to remove this yellow bracket color?

#

it just appeared

maiden fable
unkempt canyonBOT
#

discord.ui.button(*, label=None, custom_id=None, disabled=False, style=<ButtonStyle.secondary: 2>, emoji=None, row=None)```
A decorator that attaches a button to a component.

The function being decorated should have three parameters, `self` representing the [`discord.ui.View`](https://discordpy.readthedocs.io/en/master/interactions/api.html#discord.ui.View "discord.ui.View"), the [`discord.Interaction`](https://discordpy.readthedocs.io/en/master/interactions/api.html#discord.Interaction "discord.Interaction") you receive and the [`discord.ui.Button`](https://discordpy.readthedocs.io/en/master/interactions/api.html#discord.ui.Button "discord.ui.Button") being pressed.

Note

Buttons with a URL cannot be created with this function. Consider creating a [`Button`](https://discordpy.readthedocs.io/en/master/interactions/api.html#discord.ui.Button "discord.ui.Button") manually instead. This is because buttons with a URL do not have a callback associated with them since Discord does not do any processing with it.
slate swan
#

can i remove it somehow?

#

I don `t like it

#

idk

#

that is normal

slate swan
supple thorn
#

That isn't related to discord bots

supple thorn
#

Ask here

slate swan
#

i made this discord command

async def meow(ctx):
    await ctx.send('rawr')```
 and when i use the command it doesn't work even thought im doing everything and writing everything right
frozen patio
#

Show all your code please

slate swan
# frozen patio Show all your code please
from discord.ext import commands
import time
bot = commands.Bot(command_prefix='!')

@bot.event
async def on_ready():
 print(f"Bot is online!")

@bot.command()
async def meow(ctx):
    await ctx.channel.send('rawr')
@bot.event
async def on_message(message):
    with open('blacklistedwords.txt', 'r+') as file:
        swearwords = file.read()
    author = message.author
    if message.content in swearwords:
        await message.delete()
        await message.channel.send('You cant send this here! <@' + str(author.id) + '>' , delete_after=3.0)
bot.run('')```
#

change bot.event to bot.listen()

#

my issue is the commands not the events

frozen patio
#

Well I see it

slate swan
#

k do it yourself

slate swan
frozen patio
#

You have an on_message event which overrides the command

#

You need to add await bot.process_commands(message)

#

At the end on the on_message event

supple thorn
#

Yes i know

supple thorn
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/master/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...
supple thorn
#

Use this if you don't want to put the process_commands code

boreal ravine
light violet
#

how to make my anti ban more fast?

slate swan
#

what is more fast?

light violet
# slate swan what is *more fast*?

taskpool 5 threaded bans gives 50 bans bypassing my antinuke i want my antinuke to ban the nuker / stop the nuker at less than 50 bans

#

i used aiohttp then httpx then the fastest one aiosonic to call discord api more fast to stop the nuker

#

still giving 50 bans

#

i tried loggin audit more faster btw didnt work it made it more slow

#

async for entry in guild.audit_logs(limit=1,
after=datetime.datetime.now() -
datetime.timedelta(minutes=2),
action=disnake.AuditLogAction.ban):

#

this one giving 50 bans

slate swan
#

ok.. here idk how to make it fast

#

lmao and btw next time use

#

!code when pasting code

unkempt canyonBOT
#

Here's how to format Python code on Discord:

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

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

regal pulsar
#

vsc right

#

its your theme

slate swan
#

he's prolly using some extension

regal pulsar
#

or some extension

slate swan
#

yeah

regal pulsar
light violet
#

who has the deep knowledge of py and dpy

slate swan
#

using aiothtp is a better way.. that's wht i can suggest

light violet
#

i need him

light violet
regal pulsar
#

!d discord.Guild.create_role

unkempt canyonBOT
#

await create_role(*, name=..., permissions=..., color=..., colour=..., hoist=..., display_icon=..., mentionable=..., reason=None)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).

Creates a [`Role`](https://discordpy.readthedocs.io/en/master/api.html#discord.Role "discord.Role") for the guild.

All fields are optional...
light violet
#

i used everything

slate swan
slate swan
regal pulsar
#

what do i pass for permissions

light violet
#

if the nuker can ban 50 bans why cant i stop it at less than 50 ban why do i get limited

regal pulsar
#

its supposed to be a permissions integer

slate swan
#

!d discord.Permissions

regal pulsar
#

but

unkempt canyonBOT
#

class discord.Permissions(permissions=0, **kwargs)```
Wraps up the Discord permission value.

The properties provided are two way. You can set and retrieve individual
bits using the properties as if they were regular bools. This allows
you to edit permissions...
regal pulsar
slate swan
#

:>

modern fiber
#

can anybody help me with launching bot on heroku?

#

I don't know how to install this Heroku CLI

#

anybody?

loud junco
modern fiber
#

nvm hosted it its easy

loud junco
#

nc

#
class TopGG(commands.Cog):
  def __init__(self, bot):
        self.bot = bot
        self.token = 'dbl_token'  # set this to your DBL token
        self.dblpy = dbl.DBLClient(self.bot, self.token, webhook_path='/dblwebhook', webhook_auth='password', webhook_port=5000)
    
  @commands.Cog.listener()
  async def on_dbl_vote(self, data):
    if message.channel.type == discord.ChannelType.private:
      return
    if message.channel.id == 970895283250675813:
      data = message.content.split(" ")
      user = re.sub("\D", "", data[4])
      hehehe = bot.get_user(user) or await bot.fetch_user(user)
      hehehe = hehehe.id
      db[f'{hehehe}cooked_pogchop'] += 42
      db[f'{hehehe}voteCount'] += 1
  
      voteCount = db[f'{hehehe}voteCount']
      if voteCount < 10:
        role = message.guild.get_role(971310924478705695)
      elif voteCount < 18:
        role = message.guild.get_role(971310601668288512)
      elif voteCount < 69:
        role = message.guild.get_role(971311031555072020)
      elif voteCount < 100:
        role = message.guild.get_role(971311323658977281)
      elif voteCount < 420:
        role = message.guild.get_role(971311024051486742)
      elif voteCount >= 420:
        role = message.guild.get_role(971311028694577162)
      else:
        role = message.guild.get_role(905626727005454457)
      await message.author.add_roles(role)
    await bot.process_commands(message)
```nothing is working
#

and where do i define message

modern fiber
#

Uh guys,

loud junco
#

?

modern fiber
#

what is wrong

torn sail
#

Put the color FFCB4C in a string

#

The # is commenting the line

slate swan
gloomy fog
#

If i want to check if members have a certain amount of messages, is it better to check every single member all the time if they have a certain amount of messages or once they send a message to check if they sent a certain amount of messages

placid skiff
#

uhm colors object in discord doesn't take hex

torn sail
#

They can

modern fiber
#

Yo any idea what do I paste here?

#

Im hosting bot on heroku

#

trying to update it

placid skiff
unkempt canyonBOT
#

class discord.Colour(value)```
Represents a Discord role colour. This class is similar
to a (red, green, blue) [`tuple`](https://docs.python.org/3/library/stdtypes.html#tuple "(in Python v3.10)").

There is an alias for this called Color...
loud junco
#

||alt f4|| jkjk

modern fiber
placid skiff
#

.-.

torn sail
modern fiber
civic forge
#

!d function

unkempt canyonBOT
#

A series of statements which returns some value to a caller. It can also
be passed zero or more arguments which may be used in
the execution of the body. See also parameter, method,
and the Function definitions section.

slate swan
#

bump

loud junco
#
class TopGG(commands.Cog):
  def __init__(self, bot):
        self.bot = bot
        self.token = 'dbl_token'  # set this to your DBL token
        self.dblpy = dbl.DBLClient(self.bot, self.token, webhook_path='/dblwebhook', webhook_auth='password', webhook_port=5000)
    
  @commands.Cog.listener()
  async def on_dbl_vote(self, data):
    if message.channel.type == discord.ChannelType.private:
      return
    if message.channel.id == 970895283250675813:
      data = message.content.split(" ")
      user = re.sub("\D", "", data[4])
      hehehe = bot.get_user(user) or await bot.fetch_user(user)
      hehehe = hehehe.id
      db[f'{hehehe}cooked_pogchop'] += 42
      db[f'{hehehe}voteCount'] += 1
  
      voteCount = db[f'{hehehe}voteCount']
      if voteCount < 10:
        role = message.guild.get_role(971310924478705695)
      elif voteCount < 18:
        role = message.guild.get_role(971310601668288512)
      elif voteCount < 69:
        role = message.guild.get_role(971311031555072020)
      elif voteCount < 100:
        role = message.guild.get_role(971311323658977281)
      elif voteCount < 420:
        role = message.guild.get_role(971311024051486742)
      elif voteCount >= 420:
        role = message.guild.get_role(971311028694577162)
      else:
        role = message.guild.get_role(905626727005454457)
      await message.author.add_roles(role)
    await bot.process_commands(message)
```nothing is working
and where do i define message
someone help ;-;
slate swan
#

bro

loud junco
#

no error

slate swan
#

stop copy pasting ur shit

modern fiber
#

What do I put in here? Im trying to update the bot after adding new commands, hosting it on heroku by git.

loud junco
slate swan
#

you dont even have ur dbl tkn, etc

loud junco
#

is refresh_token intended to become a string?

slate swan
#

well app

modern fiber
#

bruh is there really noone that can help me?

slate swan
#

according to docs,

loud junco
#

oo ok

gloomy fog
slate swan
modern fiber
#
  1. I tried, no help so Im fucking asking here.
#

Just help or don't speak at all

slate swan
#

bro πŸ’€ you dk what a commit msg is

modern fiber
#

I don't.

placid skiff
#

Chill up guys

slate swan
#

😱

modern fiber
#

If you didn't know it doesn't make sense to me

torn sail
#

Basically it’s the message the tells what happened in the commit

modern fiber
#

What do I do?

torn sail
#

I only use git the terminal section of pycharm and not pycharms built in way so I’m not sure how it works

modern fiber
#

I can use the terminal section too?

slate swan
torn sail
#

Probably

velvet compass
#

I would recommend using git on a standalone terminal, I've never had luck with built in tools for it

modern fiber
#

So what do I do with terminal section

slate swan
#

it sjust a fucking comment to know what u changed

velvet compass
#

Keep it civil please

modern fiber
#

so I just type I changed this..

#

and I press push and commit?

slate swan
#

yes.

modern fiber
#

And new I press commit and push?

slate swan
modern fiber
#

Which?

slate swan
#

idfk all the files in ur folder

loud junco
#
self.dblpy = dbl.DBLClient(self.bot, self.token, webhook_path='/dblwebhook', webhook_auth='password', webhook_port=5000)
```what is webhook_path
slate swan
loud junco
#

my webhook website?

modern fiber
loud junco
slate swan
#
def get_new_token(old_token): # gets new refresh_token
    headers = {
        'Content-Type': 'application/x-www-form-urlencoded'
    }
    data = {
        'client_id': CLIENT_ID,
        'client_secret': CLIENT_SECRET,
        'grant_type': 'refresh_token',
        'refresh_token': old_token
    }
    r = requests.post(
        f"{API_ENDPOINT}/oauth2/token",
        data=data,
        headers=headers
    )
    print(f"\n\n{r.status_code}:{r.text}\n\n")
    return r.json()

my function, which returns this:
400:{"error": "invalid_grant"}

my code seems identical to the docs sample (https://discord.com/developers/docs/topics/oauth2#authorization-code-grant-access-token-response)

i have no clue what im doing wrong

modern fiber
#

I have those.

#

@slate swan

loud junco
#

then choose which one u wanna commit:/

torn sail
#

Honestly terminal is easier

modern fiber
#

how?

modern fiber
slate swan
#

just use vsc

modern fiber
#

what do I type

#

to choose it

loud junco
modern fiber
slate swan
#

ok so pop up the terminal

modern fiber
#

ok

slate swan
#

and navigate to the folder with the source

modern fiber
#

how.

velvet compass
modern fiber
#

bruh pepe_happy_cry

slate swan
#

the terminal will open a specific folder by default

#

i assume you're using windows?

modern fiber
#

yes

slate swan
#

where do you store your code?

#

Documents? Desktop?

modern fiber
#

nowhere else?

slate swan
#

where is it at

modern fiber
#

No idea

torn sail
#

On the button there’s like a few buttons

slate swan
#

did you use pycharm to create the project

modern fiber
#

Yes

torn sail
#

Click terminal

modern fiber
slate swan
#

has the built in terminal opened?

torn sail
#

Then enter the git commands

modern fiber
slate swan
modern fiber
#

Yes.

slate swan
velvet compass
#
git add . # add all files in current directory
git commit -m "Useful message"
git push <remote name> <branch name> # commonly origin main
slate swan
#

or just uh, follow that

modern fiber
#

what are those two <remote name> <branch name>

slate swan
#

are you using github

modern fiber
#

yes

slate swan
#

have you made a repository through the website yet

modern fiber
modern fiber
#

git create and all that

slate swan
#

ok so you'll need to set the origin URL

#

otherwise git push will fail

#

open the github website

velvet compass
# modern fiber what are those two <remote name> <branch name>

The remote is the name of the github hosted remote git repository, commonly called origin. The branch is the git repo branch you are working on, and the target of where you want to push your commit to.

Also, yes, you will need to create a GitHub repo on their website before pushing anything from your local repo

slate swan
#

actually maybe we should take this somewhere else

#

and @ me there

modern fiber
#

Okay, I'll add you and do it later . Have to go yo school right now sadly, but thanks.

#

Really appreciated bro.

slate swan
#

no problem, just remind me when you need help

loud junco
#

anyone ghost ping?

velvet compass
slate swan
#
def get_new_token(old_token): # gets new refresh_token
    headers = {
        'Content-Type': 'application/x-www-form-urlencoded'
    }
    data = {
        'client_id': CLIENT_ID,
        'client_secret': CLIENT_SECRET,
        'grant_type': 'refresh_token',
        'refresh_token': old_token
    }
    r = requests.post(
        f"{API_ENDPOINT}/oauth2/token",
        data=data,
        headers=headers
    )
    print(f"\n\n{r.status_code}:{r.text}\n\n")
    return r.json()

my function, which returns this:
400:{"error": "invalid_grant"}

my code seems identical to the docs sample (https://discord.com/developers/docs/topics/oauth2#authorization-code-grant-access-token-response)

i have no clue what im doing wrong

velvet compass
slate swan
#

oAuth dance lol

#

lemme dbuole check

#

hm it seems as if i am passing refresh

#

ooh never saw that channel tbh lol

stiff gorge
#

how to add 2 url buttons in a embed ?

slate swan
#

thats a thread, so makes sense

#

heres the code^

slate swan
#

userids is a list of authorized user ids

stiff gorge
#

ty

slate swan
#

button1 and button2 being discord.ui.Button objects

rare saddle
#

How to make sure that it does not go beyond the scope and does not fill up too quickly

regal pulsar
rare saddle
#

And even went beyond

regal pulsar
#

hmm

slate swan
#

That is a math problem, not even directly programming

#

233 is 100% of the bar, 151 is x% of the bar.
Fill the bar with the x percentage

#

Which would be around 63% I believe

crisp reef
#

Anyone have any resources or advice on how to get started?

slate swan
#

The documentation is your way to go

slate swan
#

Ehh?

#

What are you doing right now

#

You don't need to put any percentage sign

rare saddle
slate swan
#

!e
p = 100
x = 7331
y = 1337

print(f"Percentage: {100*y/x}")

unkempt canyonBOT
#

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

Percentage: 18.23762106124676
slate swan
#

You don't need any percentage sign

#

Just work with floats

rare saddle
slate swan
#

@slate swan does lightbulb allow timing members out? πŸ˜”

#

uhhh nvm not required, forgot that discord has an in-built command for that

slate swan
#

hikari.Member.edit

slate swan
#

How do I disable a button?

#

And specify the button

#

!d discord.Button.disabled

unkempt canyonBOT
slate swan
#

set this to True

nova stag
#

i am getting this error please help

slate swan
craggy cloak
#

How can I add when someone is using a slash command the bot also send that the user used the command?

@bot.event
async def on_command_completion(ctx):
    channel = bot.get_channel(972146584852770856)
    ce = discord.Embed(title=f"**Command used**", description=f"The command ``{ctx.command.name}`` was used by {ctx.author.mention}", color=discord.Color.blue(), timestamp=ctx.message.created_at)
    await channel.send(embed=ce)
    await asyncio.sleep(5)

slate swan
#

you need to create buttons with discord.ui.Button , not discord.Button

slate swan
#

Ill try to send code

unkempt canyonBOT
#

Hey @slate swan!

You either uploaded a .txt file or entered a message that was too long. Please use our paste bin instead.

rare saddle
#

How to find the rank (Determined by level)?

slate swan
rare saddle
slate swan
slate swan
paper sluice
#

Create one instance and use that lol

stray carbon
#
class HelpDropdown(nextcord.ui.Select):
    def __init__(self, help_command: "PaginatedHelpCommand", options: List[nextcord.SelectOption]):
        super().__init__(placeholder="Choose a category", min_values=1, max_values=1, options=options)
        self.help_command = help_command
    
    async def callback(self, interaction):
        embed = await self.help_command.cog_help_embed(self.help_command.context.bot.get_cog(self.values[0].lower()))   
        pages = HelpButtonMenuPages(
            ctx=self.help_command.context,
            source=HelpPageSource(self.help_command, self.help_command.embed_fields),
            disable_buttons_after=True
        )
        await pages.start(self.help_command.context)

this sends a new message but i want it to edit the embed
nextcord-ext-menus btw

slate swan
#

hm

stray carbon
#

how can i make it edit current message...

slate swan
#

after "disable_buttons_after=True"

#

add a wait time for 3 seconds

stray carbon
#

wait_time=3.0?

slate swan
#

yes.

#

and try again

formal basin
#

Anyone know how a bot command can create a list in json

slate swan
#

i think your code is just going to fast

stray carbon
slate swan
#

so what you're trying is to make the code edit an embed?

stray carbon
#
Traceback (most recent call last):
  File "C:\Users\Akai\AppData\Local\Programs\Python\Python38\lib\site-packages\nextcord\ui\view.py", line 371, in _scheduled_task
    await item.callback(interaction)
  File "C:\Users\Akai\Desktop\Sugari\cogs\info.py", line 13, in callback
    pages = HelpButtonMenuPages(
  File "C:\Users\Akai\Desktop\Sugari\cogs\info.py", line 67, in __init__
    super().__init__(**kwargs)
  File "C:\Users\Akai\AppData\Local\Programs\Python\Python38\lib\site-packages\nextcord\ext\menus\menu_pages.py", line 304, in __init__
    super().__init__(source, **kwargs)
  File "C:\Users\Akai\AppData\Local\Programs\Python\Python38\lib\site-packages\nextcord\ext\menus\menu_pages.py", line 32, in __init__
    ButtonMenu.__init__(self, **kwargs)
  File "C:\Users\Akai\AppData\Local\Programs\Python\Python38\lib\site-packages\nextcord\ext\menus\menus.py", line 837, in __init__
    Menu.__init__(self, timeout=timeout, *args, **kwargs)
TypeError: __init__() got an unexpected keyword argument 'wait_time'
stray carbon
#

to send cog help

slate swan
#

i'm still learning python so i am not sure

#

ask someone higher than me or wait for them to respond to this

slate swan
stray carbon
stray carbon
heady sluice
#

!d nextcord.Interaction.edit_original_message

unkempt canyonBOT
#

await edit_original_message(*, content=..., embeds=..., embed=..., file=..., files=..., view=..., allowed_mentions=None)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).

Edits the original interaction response message.

This is a lower level interface to [`InteractionMessage.edit()`](https://nextcord.readthedocs.io/en/latest/api.html#nextcord.InteractionMessage.edit "nextcord.InteractionMessage.edit") in case you do not want to fetch the message and save an HTTP request.

This method is also the only way to edit the original message if the message sent was ephemeral.
heady sluice
#

wait it's a paginator

stray carbon
#

yes

slate swan
#

nextcords source code is so off compared to other forks

#

its so different

heady sluice
#

await self.help_command.cog_help_embed(self.help_command.context.bot.get_cog(self.values[0].lower()))
brainmon

slate swan
stray carbon
#

πŸ˜…

boreal ravine
heady sluice
#

you aren't even using embed and pages

slate swan
craggy cloak
stray carbon
#

wdym im using

#
    async def cog_help_embed(self, cog: commands.Cog) -> nextcord.Embed:     
        embed = nextcord.Embed(
            title=f"{cog.qualified_name} Commands", colour=self.COLOUR
        )
        if cog.description:
            embed.description = cog.description

        filtered = await self.filter_commands(cog.get_commands(), sort=True)
        for command in filtered:
            name=f"> `{self.get_command_signature(command)}`"
            value=command.short_doc or "..."
            self.embed_fields.append((name, value))

        embed.set_footer(text=f"Type {self.context.clean_prefix}help <command> for more info on a command.")
        embed.set_author(name=f"{cog.qualified_name.capitalize()} Help", icon_url=self.context.bot.user.display_avatar)
        return embed

    async def send_cog_help(self, cog: commands.Cog):
        """implements cog help page"""
        prefix = self.context.clean_prefix
        invoked_with = self.invoked_with
        embed = await self.cog_help_embed(cog)       
        pages = HelpButtonMenuPages(
            ctx=self.context,
            source=HelpPageSource(self, self.embed_fields),
            disable_buttons_after=True
        )
        await pages.start(self.context)
slate swan
#

bro i recommended disnake to do a total rewrite so they can be the best fork but i think im gonna contribute to nextcord😳

cobalt jacinth
#

is there any tutorial for making a website for discord bot settings ?
not sure how the website is able to access the server list etc.

stray carbon
boreal ravine
slate swan
#

ill take a look at that😏

boreal ravine
heady sluice
#

Idk I have so many questions

stray carbon
boreal ravine
stray carbon
#

its help embed function for cog?

slate swan
#

who knows about coding here

heady sluice
#

what kind of question is that

stray carbon
slate swan
#

wrong server

neat shuttle
slate swan
stray carbon
#

isnt there way to append it only once lol

slate swan
#

why dms?

#

This channel is made for help, no need to get in DMs

stray carbon
slate swan
#

hey kryptonpithink

slate swan
#

hoi

stray carbon
cobalt jacinth
#

is there any tutorial for making a website for discord bot settings ?
not sure how the website is able to access the server list etc.

slate swan
#

seen you allot here latelypithink

#

terrible, got exams coming and i feel like i know nothing peepoSheep

#

you?

heady sluice
slate swan
stray carbon
#

and i found another error

slate swan
#

I just got until the 10th of June

#

Then bye bye pandaWeee

stray carbon
#

cog_help_embed appends embed_fields it everytime the function is run

heady sluice
slate swan
# slate swan pog

yes but now i have anxiety that im not going to join the electronic course in my schoolπŸ˜”

stray carbon
#

what will that do

slate swan
#

How to use commands.Cog.listener in an extension

#

it comes with has no setup function

heady sluice
#

people won't be able to select another option once one was selected

slate swan
#

just be confident, you probably tried your best and you can't do more

#
@commands.Cog.listener()
async def on_command_error(ctx, error):
    if isinstance(error, commands.CommandOnCooldown):
        x = round(error.retry_after, 2)
        await ctx.reply(f"Slow down, you can retry after {x} seconds")
```My codee
#

just like me for the military, i applied at the swiss armed forces but not sure if i will get in - but i tried my best

heady sluice
#

that has got nothing to do with no setup function

slate swan
heady sluice
#

you've got no setup function

slate swan
slate swan
heady sluice
#

you do setup for the cog

slate swan
#

its not in a cog

#

writing is most likely not the only thing they take attention to honestly

heady sluice
#

just a setup function in the file

stray carbon
slate swan
slate swan
#

how do i ddo that?

#

but you cant assume people these dayspithink

slate swan
# heady sluice bro 😭
import discord
from discord.ext.commands import *
from googlesearch import search
import danksearch
import asyncio
from discord.ext import commands
@commands.Cog.listener()
async def on_command_error(ctx, error):
    if isinstance(error, commands.CommandOnCooldown):
        x = round(error.retry_after, 2)
        await ctx.reply(f"Slow down, you can retry after {x} seconds")```
slate swan
slate swan
heady sluice
slate swan
slate swan
heady sluice
#

you use cog decorator when you're in a cog

#

you have to make a cog for it

stray carbon
slate swan
stray carbon
#

pages.start sends not edits

slate swan
#

well not really but i have told what im able to do and ive had vouches from allot of my teachers

heady sluice
stray carbon
#

pages.edit does not exist

slate swan
heady sluice
#

no

slate swan
#

rip

slate swan
#

how long until you know?

#

@slate swan How do i purge the last 50 messages in a channel since the delete_messages method requires an iterable with message ids and I don't got those ids otherwise I'll have to get the history and dew it

heady sluice
stray carbon
slate swan
#

!d discord.TextChannel.purge

unkempt canyonBOT
#

await purge(*, limit=100, check=..., before=None, after=None, around=None, oldest_first=False, bulk=True, reason=None)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).

Purges a list of messages that meet the criteria given by the predicate
`check`. If a `check` is not provided then all messages are deleted
without discrimination...
slate swan
heady sluice
#

you could like copy paste the start method and edit the part you don't like

slate swan
#

Doesn't it have something similar?

slate swan
stray carbon
#

also embed_fields was getting appended multiple times which can be fixed by set() but uh how do i remove {}?

neat shuttle
slate swan
#

That's yikes

slate swan
slate swan
heady sluice
#

just self.embed_fields = [] at the start of cog_help_embed

heady sluice
#

so it's reset

unkempt canyonBOT
#

discord/abc.py line 135

iterator = channel.history(limit=limit, before=before, after=after, oldest_first=oldest_first, around=around)```
slate swan
#

oooff

#

well then

#

thanks a lot cirno

stray carbon
#

do you have any example?

visual island
slate swan
#

πŸ‘‹

neat shuttle
# slate swan I did, its only got `delete_message` and `delete_messages`

this is what i found

messages = (
    await bot.rest.fetch_messages(channel_id)
    .take_until(lambda m: datetime.datetime.now(datetime.timezone.utc) - datetime.timedelta(days=14) > m.created_at)
    .limit(count)  # Limit the messages to the amount you want deleted
)

# Where channel ID is the channel you are deleting the messages from
await bot.rest.delete_messages(channel_id, messages)```
slate swan
neat shuttle
#

fuck i hate mobile lol

neat shuttle
#

ye then idk

slate swan
slate swan
#

It's like hi πŸ‘‹
not hi πŸ‘‹ (hi take slap )

slate swan
#

That's long yoikes

paper sluice
#
from . import (
    utils as utils,
    opus as opus,
    abc as abc,
    ui as ui,
    app_commands as app_commands,
)

lmao what

slate swan
vale wing
#

Sus relative import

slate swan
#

I know in 3 months if I'm recruited onionpray

#

Good luck you got this!

slate swan
#

the relative imports with parenthesisπŸ˜”

#

Ye I see

#

from.

#

(. )

#

that just means from the current folder

#

.. means from the parent folder and so on

slate swan
paper sluice
#

no thats not the problem, why is it import xyz as xyz

slate swan
#

?

#

yeah thats unnecessary as well

fossil adder
#

i need help

slate swan
#

Ask

slate swan
paper sluice
unkempt canyonBOT
#

discord/__init__.py lines 46 to 52

from . import (
    utils as utils,
    opus as opus,
    abc as abc,
    ui as ui,
    app_commands as app_commands,
)```
fossil adder
#

why does this work

rare saddle
#

How to find the maximum level among all participants on the server? MongoDB

fossil adder
#

but this wont

fossil adder
#

i need to define it

#

but how do i

slate swan
#

Ye?

slate swan
fossil adder
rare saddle
slate swan
#

are u in inter or commanf

vale wing
slate swan
#

Or event

fossil adder
#

it doesnt work in event nor does it work in command

vale wing
slate swan
fossil adder
vale wing
fossil adder
slate swan
#

ctz. Autor
Id

fossil adder
slate swan
#

I hate typing in mobile

fossil adder
#

lol

vale wing
# fossil adder

There's no event called "balance" what are you trying to do

fossil adder
#

im tryna make an economy boy

vale wing
#

It's supposed to be a command, decorate it with command

slate swan
#

bot?

fossil adder
#

bot

slate swan
fossil adder
slate swan
#

ok

fossil adder
#

thanks for helping

slate swan
#

.

#

sparky how do i put gif in messgae?

#

message*

#

like





here gif```
#

ctx.send("gif link")

#

uh

#

not that

#

?

#

like i wanna to but some rainbow line down and up message

paper sluice
slate swan
#

!e

print("message \n \n \n gif" )

unkempt canyonBOT
#

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

001 | message 
002 |  
003 |  
004 |  gif
slate swan
#

uh let me try

#

okay so i copy url of that gif

#

Yes

slate swan
#

like

slate swan
# slate swan <@456226577798135808> How do i purge the last 50 messages in a channel since the...

To purge messages you need to:

  1. fetch the history of the channel you want to purge
  2. bulk delete all fetched messages (after filtering)
# bulk delete only allows deleting messages younger than 14 days
bulk_delete_limit = datetime.datetime.now(datetime.timezone.utc) - datetime.timedelta(days=14)
iterator = (
    bot.rest.fetch_messages(channel_id)
    .take_while(lambda message: message.created_at > bulk_delete_limit)
    .filter(lambda message: ...)
    .limit(500)  # remember to set a reasonable limit to avoid ratelimits
)```
```py
# simple but slow, fetches the entire history before deleting
await bot.rest.delete_messages(channel_id, await iterator)


# with chunking, deletes progressively
async for messages in iterator.chunk(100):
    await bot.rest.delete_messages(channel_id, messages)


# with chunking and tasks, deletes concurrently but won't stop at the first error
tasks = []
async for messages in iterator.chunk(100):
    task = asyncio.create_task(bot.rest.delete_messages(channel_id, messages))
    tasks.append(task)

await asyncio.wait(tasks)  # this is optional```
#

sarthak really

#

in this message with ```

#

im gonna die

#

and down is like gif

#

that line

#

sarthak should be a teacher 😭

slate swan
#

up is message and down is line

slate swan
#

i just did /tag purge, and copy pasted the output here

neat shuttle
#

LOL

slate swan
#

sarthak is such a lovely friend

#

very

slate swan
#

sarthak

#

ye

#

i connected to the gateway successfully yesterday with my implementation

#

oh damn
yea i saw in the thread

#

best feeling ever it felt like i made my first bot😭

slate swan
fossil adder
#

im back

slate swan
fossil adder
#

i still cant fix this thing

slate swan
#

i need to put this gif under message

slate swan
maiden fable
slate swan
#

hun hun is here😩

shrewd apex
#

await ctx.send('msg/nlink')

slate swan
#

not today.

maiden fable
slate swan
#

url of gif*

#

sarthak wont fail hes an indian lad!

#

and all the indian lads are smart!

slate swan
neat shuttle
#

racist

shrewd apex
#

ok download the gif then send it as discord.file

neat shuttle
#

😭

slate swan
#

shhh

slate swan
#

its not racist i ment my lads

#

yours

#

so hunter and sarthak are my indian lads

shrewd apex
slate swan
#

not robin, robin is a big poopy head

#

😑

#

robin is not indian...

slate swan
slate swan
slate swan
slate swan
slate swan
slate swan
#

😳

#

makes sense

slate swan
#

anyways, lets get back to topic.

#

yes please

slate swan
neat shuttle
#

robin isn’t an indian name therefore he’s not indian

slate swan
#

the message is just as bad as his dropdown examples

#

neither hunter is

#

πŸ’€

#

!e discord.ui.button

#

!d discord.ui.button

unkempt canyonBOT
#

discord.ui.button(*, label=None, custom_id=None, disabled=False, style=<ButtonStyle.secondary: 2>, emoji=None, row=None)```
A decorator that attaches a button to a component.

The function being decorated should have three parameters, `self` representing the [`discord.ui.View`](https://discordpy.readthedocs.io/en/master/interactions/api.html#discord.ui.View "discord.ui.View"), the [`discord.Interaction`](https://discordpy.readthedocs.io/en/master/interactions/api.html#discord.Interaction "discord.Interaction") you receive and the [`discord.ui.Button`](https://discordpy.readthedocs.io/en/master/interactions/api.html#discord.ui.Button "discord.ui.Button") being pressed.

Note

Buttons with a URL cannot be created with this function. Consider creating a [`Button`](https://discordpy.readthedocs.io/en/master/interactions/api.html#discord.ui.Button "discord.ui.Button") manually instead. This is because buttons with a URL do not have a callback associated with them since Discord does not do any processing with it.
slate swan
#

i want to go thru the src of hikari library in depth

#

but its way too much

slate swan
neat shuttle
#

lmao

slate swan
slate swan
#

can someone help me for style of button?

slate swan
#

style=ButtonStyle.green?

maiden fable
#

Yea

slate swan
unkempt canyonBOT
#

class discord.ui.Button(*, style=<ButtonStyle.secondary: 2>, label=None, disabled=False, custom_id=None, url=None, emoji=None, row=None)```
Represents a UI button.

New in version 2.0.
maiden fable
#

!d discord.ButtonStyle.green

unkempt canyonBOT
slate swan
#

idk if im getting ignored allot or if my client cant send messages i cant tellπŸ˜”

slate swan
#

yeah ill probably commit allot to it because i told disnake about it and they didnt like the idea

#

would that be still a fork-ish library, or completely different

#

help to make it

#

probably a completely different

#

i told disnakes team to rewrite the old codebase but they disagreed so ill probably check out nextcords

#

i hate the old codebase its so old and bad

slate swan
#

...

vocal plover
#

we dont have enough time to rewrite everything from scratch

slate swan
#

We?

white citrus
#

heyo i have a problem with bot.process_command can someone help?

gloomy pond
#

Anyone help me with uni work?

vocal plover
#

It's better for us to just upgrade the existing codebase and switch out the bleh bits

slate swan
#

Yes

vocal plover
gloomy pond
#

It’s hard haha

vocal plover
#

It mostly consists of @vast gale telling me to review stuff kek

slate swan
white citrus
vocal plover
#

I don't have school/uni, so summer is when I do actually do things - holidays

slate swan
vocal plover
#

But we're already rewriting nextcord from scratch aguilt

paper sluice
#

πŸ‘€

vocal plover
#

I can't do more kekw

vocal plover
#

honestly most of the process rn is waiting for epic to rewrite http for the 17th time so it's perfect

slate swan
#

seems pretty cool and i like the idea

vocal plover
#

and then epic finds something else they dont like and rewrites it again lmao

slate swan
#

i rewrote my gateway implementation like 7 times already

quaint epoch
#

hello

paper sluice
#

how do u check the src in vsc?

paper sluice
vocal plover
quaint epoch
#

what is up with creating wrappers from scratch? why is it so popular, instead of adding new features to existing ones

vocal plover
#

I have issues

slate swan
#

yes you do

vocal plover
quaint epoch
slate swan
#

btw vco didn't you have the helper role?

vocal plover
slate swan
vocal plover
slate swan
vocal plover
#

the internet

slate swan
vocal plover
#

I just got a big list and saved it

slate swan
#

ow

vocal plover
slate swan
quaint epoch
# slate swan *how do you even get name ideas for them*

pitch: So you know the two most popular forks right?
client: no
pitch: disnake and pycord
Client: mhm
pitch: so what if, we name our fork the first part of disnake and the last of pycord?
Client: (thinks) wait b-
pitch: DISCORD, we'll name our new fork discord!

#

ez

vocal plover
#

technically the 2 most popular are nextcord and pycord

vocal plover
quaint epoch
#

hey wait, we can name our fork, the first part of nextcord and the last of pycord, NEXTCOR- wait

paper sluice
#

log πŸ˜… =πŸ’§log πŸ˜„
lemon_hyperpleased

slate swan
quaint epoch
#

.topic

lament depotBOT
#
**What feature would you be the most interested in making?**

Suggest more topics here!

quaint epoch
vocal plover
# lament depot

I've made most of them at this point, most interesting was ai based automod

quaint epoch
#

us programmers have no creativity, we do whatever stupid shit the client wants

paper sluice
#

the amount of times i have pressed shift+i in discord to get the start of the line is unreal

vocal plover
#

start of the line?

paper sluice
#

lemon_smug vim

vocal plover
#

oh lol

paper sluice
#

shift+i takes cursor to start
shift+a takes it to the end

vocal plover
#

my brain just completely didnt register what line meant lmao

white citrus
#

vco?

vocal plover
#

thats me

white citrus
#

i know

maiden fable
#

vco

slate swan
#

What's going on here

paper sluice
#

😳 procastination

white citrus
#

Can i ask for help vco?

paper sluice
#

ya sure

slate swan
#

what is vco

paper sluice
#

vcokltfre

#

huh?

vocal plover
#

no

slate swan
#
async def ban(ctx, user: discord.Member, *, reason=None):
    if reason == None:
        reason = f"{user} banned by {ctx.author}"
    await ctx.user.send(f'You have been banned for Reason: {reason}')
    await ctx.guild.ban(user, reason=reason)
slate swan
#

just user.send

slate swan
vocal plover
paper sluice
slate swan
#

Imagine ban msg and can't ban

slate swan
white citrus
vocal plover
# slate swan Imagine ban msg and can't ban

I did the opposite on a server I moderated once, it ran a check to see if I could ban myself and sent a message saying "You can't ban yourself" but i forgot the return statement

It banned me

paper sluice
#

lmao

heady sluice
heady sluice
#

wait you made the tutorial didn't u

vocal plover
#

I did indeed

heady sluice
#

I still hate what you said

vocal plover
heady sluice
#

from the very deep of my heart

white citrus
slate swan
#

hey vco

#

is nextcord getting an actual namespace to avoid clashing of namespaces?

paper sluice
#

restart ide maybe?

slate swan
#

Pip install

#

that shouldn't be the problem though, the library is not installed

paper sluice
#

from onMessage import hackMessage 😳

vocal plover
paper sluice
#

@vocal plover were u a helper b4 in this server?

slate swan
#

when does that message supposed to be sent?

paper sluice
#

ya i remember that log status πŸ˜…

slate swan
#

😳

heady sluice
white citrus
#

Why is it ignoring the prefix?
I use bot.process_command (nextcord)

slate swan
heady sluice
#

hecker

paper sluice
#

(dont say tts)

heady sluice
#

stt

paper sluice
#

fuck

slate swan
#

huh?

paper sluice
#

i knew i messed up, though it would slip past

heady sluice
slate swan
#

Ohh

#

Imagine

#

Stt

paper sluice
#

ur bot doesn't have any attr called db, make it b4 using lol

heady sluice
#

bot.db = ...

slate swan
#

do exit()

paper sluice
#

bot.db = stuf for db

#

before that line ofc lmao

heady sluice
#

after bot = commands.Bot

#

right after it

#

!botvar

unkempt canyonBOT
#

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

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

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

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

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

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

slate swan
#

)()

paper sluice
#

they need a better fuzzy matching for tags ...

heady sluice
#

read the tag

#

I will translate it to you in German if I really have to

#

jk I won't

#

or will I

paper sluice
#

by before that i dont the previous line, i mean before u use bot.db define it somewhere

heady sluice
#

you don't import a database

#

you copied all the code didn't you

paper sluice
#

bro, how did u write code to stuff with dc without initializing the stuff for db

#

wait, imma pull out that message

heady sluice
#

but the guy in the tutorial has something like bot.db = connectshit

#

I don't know aiosqlite

#

no I'm assuming from the fact that he uses bot.db

paper sluice
#

@slate swan

heady sluice
#
DB_SETTINGS = {
    'host': '...',
    'port': ...,
    'database': 'postgres',
    'user': 'pi',
    'password': '...'
}
bot.db = bot.loop.run_until_complete(asyncpg.create_pool(**DB_SETTINGS, ssl='require'))
```look it looks like this in my bot
#

yes....

#

but my internet got shut down once, now I can't start or connect to my db