#discord-bots

1 messages · Page 680 of 1

manic wing
#

ill go through it here and explain as best as possible

devout iris
#

actually a live support

manic wing
#

yeah my bot has that

silver iris
#

I’m trying to make my discord command display my json data

slate swan
silver iris
#

@slate swan hi thanks my issue is it sends all the json data including the syntax

slate swan
#

await ctx.send(json_data["keyYouWant"])

devout iris
#

...

#

it's been 9 minutes, you are determined 😄

silver iris
#

I feel like an idiot

manic wing
#

Making a userphone command where one can interact from server to server

**-- Planning -- **
You need:
---> two instances of discord.TextChannel to send and receive the output. These can be gotten by bot.get_channel. We can name these channels x being the server the command was invoked in, and y being the support channel.
---> an on_message to listen for messages sent in channel x and y
---> a db for the on_message to check for. For this i'm going to use json
--> a command to append data to the database

-- Writing --
The on_message may look something like this: ```py
async def support_on_message(message):
data = fetch_data_from_db() #data should be the 2 channel ids. lets pretend its a tuple like (id_1, id_2)
if message.channel.id not in data:
return #we dont care, it hasnt come from one of our support channels

if message.channel.id == data[0]: #id_1
channel = bot.get_channel(data[1]) #get the alternate channel the message
elif message.channel.id != data[0]: #must be id_2
channel = bot.get_channel(data[0])
await channel.send(message.content)

#this pretty much wraps up the one on one support channel stuff. However, it gets more complicated with multiple channelsThe `command` just appends data to the db:py
async def support_channel(ctx):
db = fetch_db()
db.append_data()

#

eh that took too long to write, i made a couple mistakes while writing it

unkempt canyonBOT
#

cogs/Feedback.py line 30

@commands.command(aliases=['dial', 'call', 'assistance'])```
manic wing
silver iris
#

thank you i will take a look

devout iris
manic wing
#

(will the ids ever change)

devout iris
#

no, it will be fixed

opal dirge
#

Hey so I would like to start making discord bots in py but im having an issue with finding all the resource materials on how to start (like all the functions and stuff like that) could someone please show me where i can find these?

unkempt canyonBOT
#

Hey @gloomy ferry! I noticed you posted a seemingly valid Discord API token in your message and have removed your message. This means that your token has been compromised. Please change your token immediately at: https://discordapp.com/developers/applications/me

Feel free to re-post it with the token removed. If you believe this was a mistake, please let us know!

manic wing
# devout iris no, it will be fixed

prob just make an on_message, check if the id is in either of the channels, and if it is just send the message to the channel with the other id

gloomy ferry
#

Hi i keep getting the same error code with cogs, idk what ive done wrong https://paste.pythondiscord.com/emezofagox.py
My bot.pypy bot = commands.Bot(command_prefix=".", intent=intents) for filename in os.listdir('./cogs'): if filename.endswith('.py'): bot.load_extension(f'cogs.{filename[:-3]}') bot.run("token blabla")
error codeTraceback (most recent call last): File "s:\Python\DiscordBot\Regal\cogs\georgebot.py", line 29, in <module> class GeorgeBot(commands.Cog): File "s:\Python\DiscordBot\Regal\cogs\georgebot.py", line 41, in GeorgeBot self.bot.remove_command('help') NameError: name 'self' is not defined

manic wing
#
@commands.command()
    @commands.has_permissions(administrator=True)
    async def activity(ctx, *, activity):
        await self.bot.change_presence(activity=discord.Game(name=activity))
        await ctx.send(f"Bot's activity changed to {activity}")
#

needs to be async def activity(self, ctx, *, activity)

#

you need to have self infront of all

#

remove self.bot.remove_command('help')

#

do bot = commands.Bot(help_command=None)

#

when defining bot

gloomy ferry
#
  File "C:\Users\George\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\discord\ext\commands\bot.py", line 678, in load_extension     
    self._load_from_module_spec(spec, name)
  File "C:\Users\George\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\discord\ext\commands\bot.py", line 609, in _load_from_module_spec
    raise errors.ExtensionFailed(key, e) from ediscord.ext.commands.errors.ExtensionFailed: Extension 'cogs.georgebot' raised an error: NameError: name 'self' is not defined```
#

@manic wing

manic wing
#

put self as an argument in all the functions

#

and dont do shit outside the functions

slate swan
gloomy ferry
#

i dont understand sorry

final iron
#

Also this

    @commands.has_permissions(administrator = True)
    # Put this into the category it should be cuz idk the category

    
    async def on_member_join(member):
        embed=discord.Embed(title="Welcome", description=(f'Welcome {member} to the Regal Community!'), color=self.color)
        channel = self.bot.get_channel(869302384004837377)
        await channel.send(embed=embed)
gloomy ferry
#

hm

final iron
#

Thats not going to work

gloomy ferry
#

why?

final iron
#

Theres no event decorator and there is a permission requirement on an event

gloomy ferry
#

no event decorator in cogs

final iron
#

There is

#

!d discord.ext.commands.Cog.listener

unkempt canyonBOT
#

classmethod listener(name=...)```
A decorator that marks a function as a listener.

This is the cog equivalent of [`Bot.listen()`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.Bot.listen "discord.ext.commands.Bot.listen").
gloomy ferry
#

ohh yeah

dire folio
#

how would i store the contents of a variable in a sqlite db

final iron
dire folio
#

did not realise there was one ty

gloomy ferry
#

WAIT

#

NOOOOOOOO

#

i give up, thank you mate. i need some sleep

final iron
#

Alright

slate swan
#
Traceback (most recent call last):
  File "c:\Users\Stepan\Documents\GitHub\lucifer-helltaker\main.py", line 48, in <module>
    async def whitelist(ctx:discord.Context) -> bool:
AttributeError: module 'discord' has no attribute 'Context'
manic wing
#

remove the :discord.Context

#

some reason ive linked context to discord

final iron
#

Is it not commands.Context?

manic wing
#

yeah but i wired my brain the wrong way

slate swan
#

i am using pycord yk

manic wing
#

cough bad

slate swan
#

why

manic wing
#

disnake

#

purely because i love EUQENOS

slate swan
#

ok, thats your choice

final iron
#

pycord might be objectively bad compared to the others but I don't have a lot of knowledge about forks

manic wing
#

sorry for instigating a disagreement

slate swan
craggy cloak
#

I made a Requirements.txt file in my bot should i import that file in the main.py file?

manic wing
#

requirements.txt is the naming convention

manic wing
#

pip install -r requirements.txt

craggy cloak
#

Ok so it is ok now

sage otter
#

I myself wouldn’t really know. Personally I will continue to use Danny's repo until a breaking change occurs. And full swap to Novus.

magic ore
#

I don't know much about disnake but it changed the import which isn't a good change

manic wing
#

!pypi novus

unkempt canyonBOT
manic wing
#

lol you just want this syntax

#

crap

#

it copied the wrong thing

#

i dont blame you

#

subclassing them is cancerous

slate swan
#

can i do?

if tuple in message.content:
manic wing
#

no

#

for index in tuple: if index in message.content

slate swan
#

yeah seems weird to me

pliant gulch
manic wing
#

!d any

pliant gulch
#

If message.content in tuple

unkempt canyonBOT
#
any

any(iterable)```
Return `True` if any element of the *iterable* is true. If the iterable is empty, return `False`. Equivalent to:

```py
def any(iterable):
    for element in iterable:
        if element:
            return True
    return False
manic wing
slate swan
#

why is that so?

manic wing
#

he prob has a list of filtered words or smthing

slate swan
pliant gulch
#

So why wouldn't what I sent work as well?

manic wing
#

if any(k for k in tuple if k in message.content)

manic wing
pliant gulch
#

But your not checking words...

#

Your iterating for each character in the example you sent lol

#

🤔

slate swan
manic wing
#

for k in tuple

pliant gulch
#

That just sounds dumb

manic wing
#

no…

pliant gulch
#

any(word in tuple_ for word in message.content.split())

#

This would actually, get the words of the message's content

#

Not each character..

#

!e ```py
string = "ABCDEFG"
for k in string:
print(k)

unkempt canyonBOT
#

@pliant gulch :white_check_mark: Your eval job has completed with return code 0.

001 | A
002 | B
003 | C
004 | D
005 | E
006 | F
007 | G
manic wing
#

pls reread my logic, im on mobile and i cba to get out-typed when im making better points

pliant gulch
#

Your logic still doesn't make sense after rereading 4 times

#

It wouldn't work like expected anyhow,

manic wing
#

gimme 2 min to get on my pc

pliant gulch
#

!e ```py
string = "grass"
if "ass" in string:
print("yes")

unkempt canyonBOT
#

@pliant gulch :white_check_mark: Your eval job has completed with return code 0.

yes
pliant gulch
#

E.g ^^^

manic wing
#

ok

#

so

manic wing
pliant gulch
#

No it wouldnt

#

I split the content into tokens

#

Oh wait nevermind, were using in

#

Just replace with equality operator

manic wing
magic ore
unkempt canyonBOT
#

examples/example_bot.py line 18

print(f"[LOGGED IN]: {bot.user.id}")```
`examples/example_bot.py` line 49
```py
@commands.check(lambda ctx: ctx.author.id == 270700034985558017)```
manic wing
#

also it being == would mean fucky or fuck. wouldnt get removed

#

its all pretty shambolic before regex

pliant gulch
pliant gulch
manic wing
pliant gulch
manic wing
#

🤦

manic wing
#

you realise we're going in circles because of miscomunication

pliant gulch
#

!e ```py
string = "hello fuck"
tuple_ = ("fuck",)

if [word in tuple_ for word in string.split()]:
print("yes")

unkempt canyonBOT
#

@pliant gulch :white_check_mark: Your eval job has completed with return code 0.

yes
manic wing
#

yes but did you say that...

slate swan
#

@pliant gulch thx it works but why so?

manic wing
unkempt canyonBOT
#

@manic wing :white_check_mark: Your eval job has completed with return code 0.

yes
pliant gulch
pliant gulch
#

I plan on deprecating that parameter anyhow

slate swan
pliant gulch
slate swan
manic wing
pliant gulch
#

If a list, E.g [1, 2] is inside of a string

#

That doesn't make much sense now does it

slate swan
#

correct

pliant gulch
#

Now try to say the opposite, if 1 is inside of [1, 2]

#

Now does that make sense?

slate swan
#

yes

pliant gulch
slate swan
#

thank you lol

pliant gulch
#

They did it the other way around

#

At the time, I had ZERO context it was a filtering system

manic wing
#

any(word in tuple_ for word in message.content.split())
this is extremely fucking different from
if message.content in tuple

pliant gulch
#

This was their first messsage

pliant gulch
#

The english language heavily relies on it

manic wing
#

i just assumed - i also said the if any thing 2 minutes before you, but the only thing i didnt add was a .split and apparently 'that sounds dumb'

pliant gulch
silver iris
#

I’m back anyone free to help with my json/discord bot

manic wing
unkempt canyonBOT
slate swan
magic ore
manic wing
pliant gulch
slate swan
#

@manic wing hey, i thought you can help me with my bot.

I have an issue that my bot's loading can take up to 5 minutes. After 5 minutes i get on_ready event.

https://paste.pythondiscord.com/xelawodifu.py - dont mind my shitty code

pliant gulch
#

This still would fire off when not expected to anyhow

pliant gulch
magic ore
#

it might be, i'm not sure. but yeah it definitely is not a big deal

manic wing
manic wing
#

ill chuck in a pull request for the hell of it

slate swan
#

me too, just dm me

manic wing
silver iris
lost wolf
#

discord.Intents.all() isnt a thing anymore?

slate swan
lost wolf
#

oh alright

slate swan
#

Yep

lost wolf
#

thanks

slate swan
#

Anytime!

lost wolf
#

do i have to do like

#

from discord import Intents or something?

slate swan
#

you are correct

slate swan
lost wolf
#

alright

slate swan
#

yep

lost wolf
#

may i ask what could cause this?

slate swan
#

cause what?

lost wolf
slate swan
#

weird idk

#

never encountered such an error

wicked atlas
lost wolf
#

discord and dpy

wicked atlas
#

?

lost wolf
wicked atlas
lost wolf
#

ok i fixed it

wicked atlas
#

the discord package is just a mirror of discord.py, so you don't need to install that

ruby lion
#

hello I would like to create a server... based off on python development and mainly advertising... so it is compulsory to have a custom discord bot set up rather than already built-in bots... ??

#

hello?

dusky pine
#

uh

#

it'd be ironic if you didn't create your own bot

ruby lion
#

hmmmm ok... but some built in function doesn't seem to work... though...

dusky pine
#

hwat is it

ruby lion
#

the verify system...

dusky pine
#

you can just invite some other verify bots

#

like wick

#

you probably haven't set up the permissions for them yet

ruby lion
#

umm no.. it is the problem with my code.. My friends also have the same problem... we searched up youtube and wrote this code... but it isn't working...

slate swan
ruby lion
#

it is showing some kind of error... and my friends also have the same issue...

slate swan
ruby lion
#

I asked my tutor too, but he can't help with that...

slate swan
#

You could send it here theirs allot of knowledgeable people

ruby lion
#

hmmm yeah... I will share the code...

sick birch
zenith hare
#

Does anyone know how to fix this error?

slate swan
zenith hare
slate swan
#

Idk about invites but invite is none lol

zenith hare
#

currently saves the invitations in the bot's cache, is there any way to make it more effective?

slate swan
#

Wish i could help but ive never done it before

small igloo
#

help ....

slate swan
small igloo
slate swan
small igloo
#

k

#

bruh lag, wait

slate swan
#

Alr

small igloo
#

when did u change pfp btw

slate swan
kindred epoch
#

how do i use wait_for multiple times?

small igloo
small igloo
slate swan
small igloo
final iron
#

Change your token

#

Right now

slate swan
#

Your supposed to get a var from an env file

small igloo
slate swan
final iron
#

pycharm

slate swan
small igloo
kindred epoch
slate swan
final iron
#

Pycharm projects are not public. Just put the token in the bot.run() like a normal person

slate swan
#
bot.run("token1234567890")
final iron
#

Yes

small igloo
#

k, thanks

slate swan
#

Your welcomepithink

small igloo
#

yayy finnaly it works, thanks @slate swan @final iron

#

dotenv remove?

slate swan
small igloo
small igloo
#

yayy ok thanks again xd

slate swan
#

Alwayspithink

jade tartan
#

I need help making a warn command. can someone help?

#

cuz am only getting json not py

sick birch
#

Don't use json for warn command

small igloo
sick birch
#

It's best stored in a database, something like this:

WARN_ID  USER_ID  MOD_ID  REASON
1234     1234     1234    Breaking the rules
#

If you're using relational of course

slate swan
jade tartan
slate swan
#

Sql is easy to learn

sick birch
#

Very

jade tartan
#

Can i use ur warn command @sick birch

sick birch
#

Sure though it's done using SQL

slate swan
#

Really good

sick birch
#

you can find my github linked on my profile. i wouldn't really use my bot's repo as like a resource though but it might be a decent starting place

slate swan
#

My strategy is after i learn to a certain part i stop until the next day and start from zero until i get more pages done then the day before

sick birch
#

you can take a peek at how i have mine structured and go from there

slate swan
sick birch
#

linked on my discord profile

slate swan
#

lol

sick birch
#

i can't stress enough not to use it as a resource though

#

only as a starting place or to get some sort of idea on how to structure things

small igloo
slate swan
#

dont be so harsh on yourself

sick birch
#

i mean i did spend a long time working on the bot, talked to a lot of experienced people and tried to implement the best practices but i still can't say it's the best

slate swan
#

Everybody has their weaknesses

jade tartan
sick birch
#

goes double for me lmao

slate swan
#

Slowly but deeply so i will have no weakness

sick birch
#

goals 👍

slate swan
#

Yep

jade tartan
slate swan
#

After i learn sql and i can use postgres easily i will be learning js and then something else idk i have allot of goals

pliant gulch
#

The hardest part about using postgres for me was actually setting up the database lmao

jade tartan
slate swan
sick birch
#

let me check

jade tartan
sick birch
#

/cogs/moderation.py

#

line 16

pliant gulch
#

I just can't be bothered to setup a new database, etc

pliant gulch
#

But if I ever wanted to I can just use my old schema.sql I usually use

#

And that would automatically setup the database once the manual labour is over

slate swan
#

Postgres asked for a port idk why

#

Why does it need a port?

pliant gulch
#

Because its a database server

slate swan
#

Still confused if a db is a file or a server

#

😭

sick birch
#

can be both

slate swan
#

Ah i see

sick birch
#

sqlite is a file, MySQL is a server

#

very basic explanation

slate swan
#

Why a server?

sick birch
#

Sometimes you can't just have a single file that has all of your database stuff on it

#

It's not the best for scaling

slate swan
#

Ah alr

sick birch
#

You can have multiple database servers that manage a single general "database"

#

kind of like discord bot sharding

slate swan
#

Mhmmm

sick birch
#

Discord uses apache cassandra and they do this due to the massive amount of data they have to store

slate swan
primal cliff
#

How can we code bots like ban, mute or kick

slate swan
sick birch
#

the library has built in functions for banning and kicking

pliant gulch
#

I thought discord was using Scylla db

sick birch
#

Nah

#

They use cassandra

pliant gulch
#

They haven't migrated?

primal cliff
pliant gulch
sick birch
#

Fair enough

#

Though I don't think they'd switch yet again from a fair good database

slate swan
pliant gulch
sick birch
#

Cassandra is very flexible and can scale very well, I don't think they'd switch in a span of a few years

#

Or not haha

primal cliff
sick birch
#

What does it mean by "fully compatiblee with Apache cassandra"?

sick birch
slate swan
pliant gulch
pliant gulch
#

Probably like a plug it and it works type thing

primal cliff
sick birch
#

"Explore using Scylla, a Cassandra compatible database written in C++. During normal operations our Cassandra nodes are actually not using too much CPU, however at non peak hours when we run repairs (an anti-entropy process) they become fairly CPU bound and the duration increases with the amount of data written since the last repair. Scylla advertises significantly lower repair times." listed as a long term goal, so I think you're right

slate swan
jade tartan
#
async def warn(ctx,  member : discord.Member, *, reason=None):
    await member.warn(reason=reason)
    await ctx.send(f'Warned {member.mention}')``` Can this work?
sick birch
#

Warning is a not a native discord feature

#

You'll have to implement the logic and storing of it yourself

slate swan
sick birch
#

You're going to need a database for this. A warn command without a database doesn't serve much functionality

primal cliff
#

Like this
`if message.content.startswith(j! ban):
await member.ban(What do we put here)

pliant gulch
#

Wouldn't be surprised if later on discord adds a "warn" feature, they've been adding a lot more stuff that bots usually do for a server nowadays

sick birch
#

Would be nice, yeah

slate swan
sick birch
pliant gulch
#

Would be nice, but I would also very much enjoy for them to add an endpoint if they do add such a feature

#

Easier interface, easier overall

primal cliff
sick birch
#

Yep, discord for the time being has very little native moderation tools

primal cliff
#

ok

sick birch
#

We don't provide code to people, we help them learn

#

You should get acquainted with Python first before attempting the library. It's not a beginner's library, and it has some advanced concepts such as ayncio.

slate swan
sick birch
#

^

slate swan
sick birch
#

What you may be looking for is commissions, where you pay people to write a bot for you. However this is not within the scope of the server and you'll have to do that somewhere else

primal cliff
#

But I dont understand to much the await member.ban() But what do we put in the brackets

slate swan
sick birch
#

Refer to the documentation

#

And learn a good bit of python first

#

It seems you're completely new to the language and I'd strongly recommend against jumping in head first with discord.py as a beginner

slate swan
slate swan
sick birch
#

Exactly

#

Documentation-reading skills are also very important

#

You'd be surprised how many people come here asking questions which can be solved within seconds with a quick documentation search haha

slate swan
#

I was like you but i go against it since i had allot of hard times which i dont recommend

sick birch
#

You're only going to lose interest in it, and having a bad time as a first time programmer will make you stay away from programming in general

#

First impressions matter

pliant gulch
#

People who learnt haskell as their first lang

slate swan
pliant gulch
#

APL*

sick birch
#

And it's not something you can easily fix either

slate swan
sick birch
#

It can keep a person from enjoying programming for life

slate swan
steep drift
#

hey I have a script that has an error

#

I don't think its a discord bot though

slate swan
steep drift
#

k

slate swan
#

If its ofc related to the channels topic

sick birch
#

I suppose you can send it here and we'll take a look

#

Actually no

steep drift
#

k

slate swan
steep drift
#

oh

sick birch
#

There are plenty of other channels on the left, find one that suits it

pliant gulch
steep drift
#

okay bc this is most active but ty @slate swan I will take a look there

slate swan
#

Depends on the problems relation and what channel suites it best

steep drift
#

k

pliant gulch
#

A programming language

#

That uses greek symbols

sick birch
#

Is that the acronym or...?

slate swan
#

Never heard of it

pliant gulch
#

Google it

slate swan
sick birch
#

A programming language? APL?

#

haha

slate swan
#

Indeed very confused

steep drift
sick birch
#

I wonder if you can write discord bots in assembly pithink

slate swan
#

Syntax looks like its from an alien specie

pliant gulch
#

If you want to write enough lines to make your own operating system sure, you could

sick birch
#

I mean making a discord bot is really just interacting with their servers and manipulating data

#

So i suppose you can send instructions to the NIC and whatnot

pliant gulch
#

Don't even need to manipulate data

#

Just communicate with the API and do nothing else

#

🧠

slate swan
#

Yup

sick birch
#

Then you'd just have to instruct the NIC card

slate swan
#

Pure instructions

pliant gulch
#

I'd assume you'd also be able to connect to the gateway via the network adaptor card as well

sick birch
#

right

#

i'll have to try it sometime...

#

and put myself through hell

#

Can we see the actual error?

slate swan
#

I have zero idea how to even start a os lol

sick birch
#

You can edit the linux kernel on your own if you know what you're doing

#

Oh yikes replit

#

Can we see the code?

#

I think I know what the issue is

#

Lot of people run into this from my experience

slate swan
#

No need for any

#

Are you trying to make a filter?

sick birch
#

Ah there's the issue

#

you can't msg from inside

#

when it's defined on the outside

#

Python scoping is finicky like that

#

Also use the rewrite version

#

The better way to write commands

#

You're using a really old method

#

Makes sense

slate swan
#

!d discord.ext.commands.Bot

unkempt canyonBOT
#

class discord.ext.commands.Bot(command_prefix, help_command=<default-help-command>, description=None, **options)```
Represents a discord bot.

This class is a subclass of [`discord.Client`](https://discordpy.readthedocs.io/en/master/api.html#discord.Client "discord.Client") and as a result anything that you can do with a [`discord.Client`](https://discordpy.readthedocs.io/en/master/api.html#discord.Client "discord.Client") you can do with this bot.

This class also subclasses [`GroupMixin`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.GroupMixin "discord.ext.commands.GroupMixin") to provide the functionality to manage commands.
sick birch
#

avoid following youtube tutorials or stackoverflow posts especially for discord.py

#

they get outdated really fast and teach you some bad habits

slate swan
sick birch
#

The documentation and examples on github

#

Also asking questions here where people are more than happy to help

pliant gulch
sick birch
#

I've seen this one suggested a lot, it's worth giving a read

#

I see

#

Probably going to need a database for that

slate swan
#

Yep

pliant gulch
#

Premium, I smell mee6

sick birch
#

That keeps track of how many messages each person has

slate swan
pliant gulch
#

Man, message counters are kinda limbo to me tbh

slate swan
#

Most bots have premium now

pliant gulch
#

Its easy to do, but if your using a service, cough such as repl.it

sick birch
#

Thing about message counters is they don’t scale very well

pliant gulch
#

Your gonna have gaps in your data

sick birch
#

Definitely

pliant gulch
#

Due to some downtimes, etc

sick birch
#

You should stay away from replit

slate swan
#

About to add a premium version of my botyert

sick birch
#

It’s globally agreed on that its garbage haha

sick birch
#

Not really it’s quite a computationally expensive process

slate swan
sick birch
#

Unless you update the database on message event

pliant gulch
#

Tbh, depends on how active the user is

sick birch
slate swan
sick birch
#

Programming in a nut shell

pliant gulch
#

The endpoint which gets the message history of a user or a channel has a max limit of 100 messages at a time, iir

#

Each of those is one request

sick birch
#

Then you have to loop over each message

#

Better to just do on_message

pliant gulch
#

If the user has like 15k messages, thats a lot of requests

#

You'd be ratelimited

sick birch
#

Gonna get rate limited

#

Yep

pliant gulch
#

I would go for a different approach, rather then message count levelling is much more tangible to me

sick birch
#

Even then it’s quite difficult unless you have some sort of intermediate caching like Redis

#

on_message

#

If message is from user, add 1 to that users message count

#

You’ll need some sort of data storage method that isn’t json

#

The amount of people that try to use json as a db from online tutorials drives me up the wall

pliant gulch
#

How would you even interface between repl.it and your localhost

sick birch
#

you don't

#

unless you port forward

#

sure with something like sqlite

#

please do

#

repl.it is globally agreed on to be trash

pliant gulch
#

port forwarding on something like repl.it

#

Yikes

sick birch
#

nah i mean locally

#

port forward like an sql server or something like that

#

unsafe though

pliant gulch
#

So you'd make an ngrok tunnel on the same port as your database server

sick birch
#

Or you know

#

don't use replit

slate swan
#

Im probably gonna leave or maybe comeback because i have a headache but see you guys have a great daypithink

pliant gulch
slate swan
#

Sqlite is a database

#

And youll need to learn the language SQL as sqlite uses the language to manipulate data

pliant gulch
#

Just to be clear, where exactly are you hosting its repl.it right?

#

Because if it is, sqlite won't work

slate swan
#

Most things are free unless hosting

pliant gulch
#

Do some googling, you should be able to fine one. Just make sure they don't use an ephemeral file system like repl.it

#

Because file changes will be reset after

#

And sqlite writes to a file

slate swan
#

Ok byepithink

upbeat otter
#

best of luck

sick birch
#

It's not your fault, 99% of tutorials on this subject are terrible

#

Many people make the same mistake, it's not just you don't worry

#

vscode is awesome

#

Sublime is another one

#

PyCharm also works

proper acorn
#

Why i cant client.run and bot.run in same file

sick birch
#

because you shouldn't have client and bot at the same time

proper acorn
sick birch
#

You don't

#

pick one and stick with it

proper acorn
#

:((

sick birch
#

preferable bot since it's more advanced

proper acorn
#

I cant right?

sick birch
#

bot is a subclass of client, so it does everything client can with more

#

why would you want both

proper acorn
cobalt jacinth
#

Does discord bot become slower as more server are added ?

proper acorn
#

Bot cant do the

#

Kick member, ban member

sick birch
#

bot can do that

proper acorn
#

How?

sick birch
#

member.ban()

#

member.kick()

sick birch
#

That's why sharding exists

cobalt jacinth
#

What's the limit

sick birch
#

about 2000 then you make a new shard

cobalt jacinth
#

Like how many servers till it's about time

sick birch
#

don't take my word for it

cobalt jacinth
#

Kk mine is 10 server😂

proper acorn
#

I meant

#

mention of member

maiden fable
unkempt canyonBOT
maiden fable
#

@sick birch do u know about overloading?

slate swan
#

When one channels position moves why does it make all of them move? In the sense in the channel_update position if one of the channels is moved it logs all of them as a channel moved

sick birch
#

you don't have to put anything in it

maiden fable
sick birch
#

yeah when you move a channel up the other channels move down to make space

slate swan
#

Oh thinkcat This is getting more complex than I thought

weary gale
#

how can i add text at the end of this?
avEmbed.add_field(name={user.name}

maiden fable
# sick birch I do

So my problem is... I have a paginator, which accepts Interaction as a param. But when I supply it Context, it doesn't work cz I am doing inter.target but ctx doesn't have a target attr... Sooo is there a way, that with overload, I can supply different type of code for a different overload or something?

weary gale
#

like that?

sick birch
#

!e

favNumber = 7
print(f"My favourite number is {favNumber}")
unkempt canyonBOT
#

@sick birch :white_check_mark: Your eval job has completed with return code 0.

My favourite number is 7
sick birch
#

like so

sick birch
#

You're probably looking for a custom context

weary gale
#

ohh

#

thx

slate swan
#

So here is my code ( I know if statements are v nested)

    @commands.Cog.listener()
    async def on_guild_channel_update(self,before,after):
        disabled = await self.coll.find_one({"Enabled": "False"})
        check = await self.coll.find_one({"Moved": before.id})
        if check:
            await self.coll.delete_one(check)
            print("Deleted because yes")
            return
        else:
            if disabled:
                print ("Disabled")
                return
            else:
                if before.position == after.position:
                    print("Position didnt change")
                    return
                else:
                    print(before.position)
                    print(after.position)
                    await self.coll.insert_one({"Moved": after.id})
                    await after.edit(position = before.position, reason = "Channel moved when lock was enabled")

I am trying to create a channel lock so that when a channel accidentally is moved the bot fixes it itself. However since 1 channel moves all in a 200 channel server the db inserts and deletes are using too much memory.. it works but its very slow and inefficient

maiden fable
#

Well I don't wanna modify the behavior when an Interaction is passed to the init. I just want it to behave differently for when Context is passed... I'll have to use isinstance?

weary gale
#

@sick birch
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: TypeError: add_field() takes 1 positional argument but 2 positional arguments (and 1 keyword-only argument) were given

#

i.. what

sick birch
#

!e

class numberWrapper:
  def __init__(self, num):
    self.num = num
  def __gt__(self, other):
    return self.num > other
  def __lt__(self, other):
    return self.num < other
num1 = numberWrapper(5)
num2 = numberWrapper(10)
print(num1 > num2)
unkempt canyonBOT
#

@sick birch :white_check_mark: Your eval job has completed with return code 0.

False
sick birch
#

That's operator overloading

#

Probably doesn't do what you want

maiden fable
#

So it's there for type checking only and no other use?

weary gale
#
async def avatar(ctx, user : discord.Member = None):
    if user == None:
        user = ctx.author
    userAvatar = user.avatar_url
    avEmbed = discord.Embed(colour=000000)
    avEmbed.add_field(f"name={user.name}'s avatar'", value=f'[download]({user.avatar_url})')
    avEmbed.set_image(url = userAvatar)
    
    await ctx.send(embed = avEmbed)```
why doesnt this work?
sick birch
#

No it lets you change what operators like < or > or + do

weary gale
# sick birch What's the error?

discord.ext.commands.errors.CommandInvokeError: Command raised an exception: TypeError: add_field() takes 1 positional argument but 2 positional arguments (and 1 keyword-only argument) were given

maiden fable
#

!d typing.overload

unkempt canyonBOT
#

@typing.overload```
The `@overload` decorator allows describing functions and methods that support multiple different combinations of argument types. A series of `@overload`-decorated definitions must be followed by exactly one non-`@overload`-decorated definition (for the same function/method). The `@overload`-decorated definitions are for the benefit of the type checker only, since they will be overwritten by the non-`@overload`-decorated definition, while the latter is used at runtime but should be ignored by a type checker. At runtime, calling a `@overload`-decorated function directly will raise [`NotImplementedError`](https://docs.python.org/3/library/exceptions.html#NotImplementedError "NotImplementedError"). An example of overload that gives a more precise type than can be expressed using a union or a type variable:
maiden fable
#

Lol this one

sick birch
#

Oh lmao no haven't used that yet

maiden fable
#

🤣

sick birch
#

But you'd be better off using a custom context

maiden fable
#

Hmm

sick birch
#

You can add custom methods and attributes to the ctx that d.py passes in

maiden fable
#

Never knew I'll have to make a custom context for this simple thing 😶

sick birch
#

There's a really nice example on the github page

maiden fable
#

I know how to make a custom context haha

sick birch
#

Oh great, should be a piece of cake then

maiden fable
#

Yups

#

Thanks anyways

#

;-; my bot has reached 96 servers but no response

muted valve
sick birch
maiden fable
#

Restart VSCode

gaunt ice
#

did u install in shell?

#

hm

#

hm

#

waittt

#

hm

upbeat otter
#

,-,

#

Alright

#

best of luck

#

is python even added to path?

#

lol nvm

#

environment variabes

#

this if you are on windows

#

the image smh

#

igtg, bye

maiden fable
#

!windows-path

unkempt canyonBOT
#

PATH on Windows

If you have installed Python but forgot to check the Add Python to PATH option during the installation, you may still be able to access your installation with ease.

If you did not uncheck the option to install the py launcher, then you'll instead have a py command which can be used in the same way. If you want to be able to access your Python installation via the python command, then your best option is to re-install Python (remembering to tick the Add Python to PATH checkbox).

You can pass any options to the Python interpreter, e.g. to install the [numpy](https://pypi.org/project/numpy/) module from PyPI you can run py -3 -m pip install numpy or python -m pip install numpy.

You can also access different versions of Python using the version flag of the py command, like so:

C:\Users\Username> py -3.7
... Python 3.7 starts ...
C:\Users\Username> py -3.6
... Python 3.6 starts ...
C:\Users\Username> py -2
... Python 2 (any version installed) starts ...
gaunt ice
#

OOOF

#

HM

maiden fable
#

Yea installing again is easier tbh

gaunt ice
#

try replit

maiden fable
#

No please

gaunt ice
#

nice

gaunt ice
slim lynx
#

@limber isle your code works, but is there any way to do it without throwing an error into the console?

limber isle
#

Oh, it does that? I though raising SystemExit would just exit, I forgot how it worked lol

#

just change raise SystemExit to sys.exit()

#

@slim lynx

slim lynx
#

oh nice

#

perfect

#

❤️

limber isle
#

👍🏻

boreal ravine
#

nothing

#

probably something above it raised the error

#

what IDE are you using?

#

show me an ss of the import

#

yes

#

your import

#

that caused the pylance error

#

ah

#

try restarting your IDE

#

I've gotten that error before not sure how it raises though

#

and you should put commands above your bot.run function otherwise the command won't register into the bot

quick gust
#

you will have to

prisma spoke
#

class Close(nextcord.ui.View):
    def __init__(self, emoji):
        super().__init__()
        self.value = None
        self.emoji = emoji

    @nextcord.ui.button(emoji=self.emoji,label = "Close", style=nextcord.ButtonStyle.red)```
#

self.emoji not defined

quick gust
#

you don't need to upload anything to your discord server?

#

Oh, yes

proper acorn
#
class kick_ban:
  @client.command()
  async def kick(ctx, member : discord.Member,*, reason = None):
    await member.kick()
bot.run(token)
client.run(token)```
#

Why not wwork

#

But my some bot command still work

boreal ravine
quick gust
#

what is that, that's not a proper class, you havent passed self, u have 2 .run() functions

boreal ravine
#

move it outside of the class

sick birch
#

You seem to have the gist of it down but there's still some organization you need, such as not having both a bot and a client

#

that was me

proper acorn
sick birch
#

Well yeah

quick gust
#

why capitalise p

boreal ravine
#

i thought discord.py didn't need any wifi to use though

sick birch
#

huh

maiden fable
#

Bruh

slate swan
#

.run() needs it

quick gust
#

what

maiden fable
#

How is it gonna connect to the API and the websocket then

slate swan
#

or login/connect etc...

sick birch
#

the whole point of discord.py is to interact with discord?

maiden fable
#

What do yoh think bot.latency is?

sick birch
#

which is on a different network?

#

why would you think using it w/o wifi would work...

slate swan
#

😂 i think he's aware?

sick birch
#

well anyway it does need wifi to work

#

big brain moment right here

boreal ravine
#

but how is my wifi a problem though

sick birch
#

because you have it off

slate swan
#

bot.run('token') thats what they have as their token

prisma spoke
#
class Tickett(nextcord.ui.View):
    def __init__(self, emoji):
        super().__init__()
        self.value = None
        self.emoji = emoji

    @nextcord.ui.button(emoji=self.emoji,label = "Ticket", style=nextcord.ButtonStyle.gray)
    async def tickettt(self, button: nextcord.ui.Button, interaction: nextcord.Interaction):
        categ = nextcord.utils.get(interaction.guild.categories, id=843120245908176897)
        await interaction.response.send_message("Creating a ticket for you, this may take a while!", ephemeral=True)
        ticket_channel = await categ.create_text_channel(name=f"ticket-{interaction.user.name}#{interaction.user.discriminator}")
        embed=nextcord.Embed(description=f"<#{ticket_channel.id}> - Your ticket has been created")
        await interaction.edit_original_message(embed=embed)
        await ticket_channel.set_permissions(interaction.user, read_messages=True, send_messages=True)
        view=Close()
        await ticket_channel.send(f"{interaction.user.mention}")
        embed = nextcord.Embed(title=f"Support Needed!", description=f"A ticket opened by **{interaction.user.name}**,\n Server Display name is **{interaction.user.display_name}**\n Support will be with you soon!\, Please describe your problem in the chat!\n The **Close button** can only be used by staffs with manage messages perms!", color=0xFF0000 )
        await ticket_channel.send(embed=embed, view=view)
        
        self.value=True``` self not defined in self.emoji but its defined in self.value
sick birch
#

or at least that's what i'm inferring

boreal ravine
#

and how do I solve it

sick birch
#

turn on your wifi

quick gust
#

uh they're talking here doesn't that mean their wifi is on

boreal ravine
slate swan
sick birch
#

from what you said it seems like you had it off when you ran the bot

prisma spoke
slate swan
#

also your token is very pog

boreal ravine
slate swan
#

hm

prisma spoke
slate swan
#

wdym indent under a comment

#

uh

simple gulch
#

I'm trying to add a ftp part to my discord bot and was planning on using ftplib (unless you have some better ideas).

ftp = FTP('ftpupload.net')   # connect to host, default port

ftp.login(user='USERNAME', passwd='PASSWORD')               # user anonymous, passwd anonymous@

ftp.retrlines('LIST')     # list directory contents ```
However, I am getting this error.
```Traceback (most recent call last):
  File "main.py", line 2, in <module>
    ftp = FTP('ftpupload.net')   # connect to host, default port
  File "/usr/lib/python3.8/ftplib.py", line 119, in __init__
    self.connect(host)
  File "/usr/lib/python3.8/ftplib.py", line 154, in connect
    self.sock = socket.create_connection((self.host, self.port), self.timeout,
  File "/usr/lib/python3.8/socket.py", line 808, in create_connection
    raise err
  File "/usr/lib/python3.8/socket.py", line 796, in create_connection
    sock.connect(sa)
OSError: [Errno 99] Cannot assign requested address```
slate swan
#

you did it wrong

simple gulch
#

Any ideas?

slate swan
#

@hidden hazel you'd do it like that

undone wyvern
#

That code isn't going to run

spring flax
#

Is there a way to clone a rule, what I actually want to do is to make a role with the same permissions as another role though

spring flax
#

all the same permissions, channel permissions and guild permissions

#

basically what i want to do is create a new muted role

slate swan
simple gulch
spring flax
slate swan
slim dragon
#

can anyone tell me that how to make the bot keep the track of time of a member to join or leaving a voice channel

slate swan
#

!e py import datetime , time five_secs_ago = datetime.datetime.now() time.sleep(5) time_now = datetime.datetime.now() difference = time_now - five_secs_ago print(difference)

unkempt canyonBOT
#

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

0:00:05.025092
slate swan
#

^

slim dragon
spring flax
slate swan
spring flax
#

ah yeah forgot to press tab there

#

so that means that discord.Role.permissions returns the guild permissions of a role only, right?

slate swan
#

yea its guild specific perm

small igloo
#

what is the recommended database for economy bot?

#

hi...?

prisma spoke
#
shield() got an unexpected keyword argument 'loop'
  File "C:\Users\admin\Downloads\underdev.py", line 1153, in <module>
    bot.run`
prisma spoke
small igloo
#

send code

prisma spoke
#

its just bot.run

#

()

#

and token ofc

small igloo
#

where the error occure E

prisma spoke
#

🤷

small igloo
prisma spoke
#

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

small igloo
small igloo
prisma spoke
small igloo
#

k

small igloo
ocean leaf
slate swan
#

yes

ocean leaf
#

okay thanks

slate swan
#

:D

small igloo
#

bhre

#

what is the recommended database ;-;

prisma spoke
#

here

prisma spoke
red sundial
#
@commands.command()
    @commands.has_role(MODERATOR_ROLE_NAME)
    async def unload(self, ctx, cog: str):
        try:
            self.bot.unload_extension(cog)
        except Exception as e:
            print (e)
            await ctx.send("Could not unload cog.")
            return
        await ctx.send("Cog unloaded.")
#

why is this not working?

small igloo
red sundial
prisma spoke
red sundial
slate swan
prisma spoke
red sundial
prisma spoke
slate swan
#

maybe you're trying to unload a cog that hasn't been loaded :'/

prisma spoke
#

u wrote cog unload outside the try and except

lone basin
red sundial
shadow wraith
#

hey nobody noticed why are you unloading a cog and the unload cmd is inside a cog 💀

prisma spoke
red sundial
prisma spoke
boreal ravine
small igloo
boreal ravine
#

^unload cogs.gamble or whatever your file name is

red sundial
small igloo
prisma spoke
red sundial
small igloo
boreal ravine
prisma spoke
small igloo
#

E ok

red sundial
#

nevermind
ill take a break now

boreal ravine
#

the error never lies

small igloo
#

@prisma spoke can send the error again?

small igloo
#

k

slate swan
#

Uh pull request

prisma spoke
slate swan
#

What does that mean

#

Pull request

prisma spoke
#

idk

slate swan
#

Nice

small igloo
prisma spoke
#

fuck

small igloo
prisma spoke
#

how do i upgrade aiohttp tho?

small igloo
small igloo
prisma spoke
small igloo
#

k, np

small igloo
prisma spoke
small igloo
prisma spoke
#

but one more error

small igloo
#

hmm what is it

prisma spoke
#
Ignoring exception in on_command_error
Traceback (most recent call last):
  File "C:\Python310\lib\site-packages\nextcord\client.py", line 378, in _run_event
    await coro(*args, **kwargs)
  File "c:\Users\admin\Downloads\underdev.py", line 103, in on_command_error
    raise error
  File "C:\Python310\lib\site-packages\nextcord\ext\commands\bot.py", line 1004, in invoke
    await ctx.command.invoke(ctx)
  File "C:\Python310\lib\site-packages\nextcord\ext\commands\core.py", line 887, in invoke
    await self.prepare(ctx)
  File "C:\Python310\lib\site-packages\nextcord\ext\commands\core.py", line 821, in prepare
    await self._parse_arguments(ctx)
  File "C:\Python310\lib\site-packages\nextcord\ext\commands\core.py", line 727, in _parse_arguments
    transformed = await self.transform(ctx, param)
  File "C:\Python310\lib\site-packages\nextcord\ext\commands\core.py", line 579, in transform
    return await run_converters(ctx, converter, argument, param)  # type: ignore
  File "C:\Python310\lib\site-packages\nextcord\ext\commands\converter.py", line 1182, in run_converters
    return await _actual_conversion(ctx, converter, argument, param)
  File "C:\Python310\lib\site-packages\nextcord\ext\commands\converter.py", line 1076, in _actual_conversion
    return await converter().convert(ctx, argument)
  File "C:\Python310\lib\site-packages\nextcord\ext\commands\converter.py", line 798, in convert
    raise EmojiNotFound(argument)
nextcord.ext.commands.errors.EmojiNotFound: Emoji "🦷" not found.```
slate swan
prisma spoke
#
class TicketButton(nextcord.ui.Button):
    def __init__(self, emoji):
        super().__init__(emoji=emoji, style=nextcord.ButtonStyle.gray, label='Ticket')

    async def callback(self, interaction: nextcord.Interaction):
        await interaction.response.send_message("hello")

class Tickett(nextcord.ui.View):

    def __init__(self, emoji):
        super().__init__()
        self.add_item(TicketButton(emoji))

@bot.command()
async def t(ctx,emoji:nextcord.Emoji=None):
    await ctx.send("h",view=Tickett(emoji))```
slate swan
#

Dpy doesn't support slashes, soon, modals are coming, and dpy won't have them either

slate swan
boreal ravine
#

o

prisma spoke
slate swan
#

!d nextcord.PartialEmoji

unkempt canyonBOT
#

class nextcord.PartialEmoji```
Represents a “partial” emoji.

This model will be given in two scenarios:

• “Raw” data events such as [`on_raw_reaction_add()`](https://nextcord.readthedocs.io/en/latest/api.html#nextcord.on_raw_reaction_add "nextcord.on_raw_reaction_add")

• Custom emoji that the bot cannot see from e.g. [`Message.reactions`](https://nextcord.readthedocs.io/en/latest/api.html#nextcord.Message.reactions "nextcord.Message.reactions")...
prisma spoke
#

O

#

@slate swan

#
nextcord.ext.commands.errors.PartialEmojiConversionFailure: Couldn't convert "🧰" to PartialEmoji.```
manic wing
#

why tf has it gone to nextcord

boreal ravine
boreal ravine
slate swan
#

Right

prisma spoke
slate swan
#

I have no clue which one supports the unicode ones ngl

prisma spoke
slate swan
#

Yes ofc I do

prisma spoke
slate swan
#

I don't have any public bots

prisma spoke
#

hm

#

i also have private custom botd

#

bots

slate swan
#

ij -

small igloo
#

does anyone know why pycharm slowdown my pc

slate swan
#

because it consumes too much ram

boreal ravine
#

use sublime

verbal cairn
#

Get a better pc

spring flax
#
@bot.command()
async def clone(ctx, role : disnake.Role):
    new_role = await ctx.guild.create_role(name="Altmute")
    for channel in ctx.guild.channels:
        overwrites = channel.overwrites_for(role)
        await channel.set_permissions(new_role , overwrites)

This says set_permissions take 2 positional arguments but three were given?

small igloo
small igloo
small igloo
verbal cairn
#

I use pycharm community and my pc isn’t slowed at all so

manic wing
#

!d discord.TextChannel.set_permissions || overwrites=overwrites maybe? gotta check docs

unkempt canyonBOT
#

await set_permissions(target, *, overwrite=see - below, reason=None, **permissions)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).

Sets the channel specific permission overwrites for a target in the channel.

The `target` parameter should either be a [`Member`](https://discordpy.readthedocs.io/en/master/api.html#discord.Member "discord.Member") or a [`Role`](https://discordpy.readthedocs.io/en/master/api.html#discord.Role "discord.Role") that belongs to guild.

The `overwrite` parameter, if given, must either be `None` or [`PermissionOverwrite`](https://discordpy.readthedocs.io/en/master/api.html#discord.PermissionOverwrite "discord.PermissionOverwrite"). For convenience, you can pass in keyword arguments denoting [`Permissions`](https://discordpy.readthedocs.io/en/master/api.html#discord.Permissions "discord.Permissions") attributes. If this is done, then you cannot mix the keyword arguments with the `overwrite` parameter.

If the `overwrite` parameter is `None`, then the permission overwrites are deleted.

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

And I’m running like tons of stuff

slate swan
verbal cairn
#

My pc isn’t like that great, I have 4096gbs of ram or smth

boreal ravine
small igloo
#

really? lemme try

spring flax
#

it says invalid permission given to the keyword now

#

or something

slate swan
verbal cairn
quick gust
small igloo
#

sup @quick gust

slate swan
#

your token.

spring flax
#

oops

slate swan
#

and could you show the line above?

#

set_permissions

spring flax
#

the error or the code?

#
@bot.command()
async def clone(ctx, role : disnake.Role):
    new_role = await ctx.guild.create_role(name="Altmute")
    for channel in ctx.guild.channels:
        overwrites = channel.overwrites_for(role)
        await channel.set_permissions(new_role, overwrites=overwrites)
boreal ravine
#

how do I add a cog_check method into my cog? ```py
async def cog_check(self, ctx):
return ctx.guild.id == 880030618275155998

small igloo
boreal ravine
#

or ctrl shift b

small igloo
slate swan
#

ctrl + b for build ,
ctrl + shift + b for build with

slate swan
small igloo
slate swan
#

it has an inbuilt terminal like build

#

where all prints will take place

#

or just use python <file path> in your terminal

small igloo
slate swan
#

in your device's terminal

small igloo
slate swan
#

the run button is ctrl + b , and use your device's terminal for pip installs

slate swan
small igloo
small igloo
slate swan
#

use it..

small igloo
spring verge
#

I was wondering how do bot devs create image form of leaderboard

#

like for example this

#

any guides/tutorial links?

slate swan
#

!Pypi pillow

unkempt canyonBOT
spring verge
#

ohh

slate swan
#

and some maths

spring verge
#

maths? 0--0

slate swan
slate swan
#

did you try visual studio code?

#

( not askin to shift to it)

small igloo
slate swan
small igloo
#

ok, thanks

unkempt canyonBOT
#

Hey @prisma spoke!

Uh-oh! It looks like your message got zapped by our spam filter. We currently don't allow .txt attachments, so here are some tips to help you travel safely:

• If you attempted to send a message longer than 2000 characters, try shortening your message to fit within the character limit or use a pasting service (see below)

• If you tried to show someone your code, you can use codeblocks
(run !code-blocks in #bot-commands for more information) or use a pasting service like:

https://paste.pythondiscord.com

prisma spoke
#
Traceback (most recent call last):
  File "/home/container/.local/lib/python3.10/site-packages/nextcord/client.py", line 351, in _run_event
    await coro(*args, **kwargs)
  File "/home/container/TRX.py", line 780, in on_command_error
    raise error
  File "/home/container/.local/lib/python3.10/site-packages/nextcord/ext/commands/bot.py", line 995, in invoke
    await ctx.command.invoke(ctx)
  File "/home/container/.local/lib/python3.10/site-packages/nextcord/ext/commands/core.py", line 895, in invoke
    await injected(*ctx.args, **ctx.kwargs)
  File "/home/container/.local/lib/python3.10/site-packages/nextcord/ext/commands/core.py", line 177, in wrapped
    raise CommandInvokeError(exc) from exc
nextcord.ext.commands.errors.CommandInvokeError: Command raised an exception: DownloadError: ERROR: Signature extraction failed: Traceback (most recent call last):
  File "/home/container/.local/lib/python3.10/site-packages/youtube_dl/extractor/youtube.py", line 1348, in _decrypt_signature
    func = self._extract_signature_function(
  File "/home/container/.local/lib/python3.10/site-packages/youtube_dl/extractor/youtube.py", line 1262, in _extract_signature_function
    res = self._parse_sig_js(code)
  File "/home/container/.local/lib/python3.10/site-packages/youtube_dl/extractor/youtube.py", line 1331, in _parse_sig_js
    initial_function = jsi.extract_function(funcname)
  File "/home/container/.local/lib/python3.10/site-packages/youtube_dl/jsinterp.py", line 245, in extract_function
    raise ExtractorError('Could not find JS function %r' % funcname)
youtube_dl.utils.ExtractorError: Could not find JS function 'na'
 (caused by ExtractorError("Could not find JS function 'na'"))```
slate swan
#

!ytdl

unkempt canyonBOT
#

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

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

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

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

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

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

@slate swan

placid skiff
# prisma spoke then what to use?

It's not a point, you can use it and doing what you want but we cannot help you due to the youtube Terms Of Service, you have to solve it by another way

prisma spoke
placid skiff
#

There is no package who follow that rules, there are some particular case for example a public research but you need a sort of license i think

slate swan
#

Don't make music bot streaming from YouTube.

prisma spoke
#

then?

slate swan
#

Then don't make a music bot.

#

As simple as that.

prisma spoke
#

its not a solution

placid skiff
#

We can't provide you a solution, that's the fact 😆

slate swan
# prisma spoke then?

Don't let people find out that your doing it, and do it yourself, because asking people for help is basically letting people know what you're doing

#

Easy

#

¯\_(ツ)_/¯

prisma spoke
#

soo i need to come.

slate swan
#

Then find the solution on your own, we can't help with that

small igloo
slate swan
#

always did

maiden fable
#

Damn my bot reached 97 servers

tawdry perch
#

dang

#

is that good or bad thing?

maiden fable