#discord-bots

1 messages · Page 849 of 1

slate swan
#

you could use fuzzywuzzy

#

!pip fuzzywuzzy

unkempt canyonBOT
slate swan
#

and check the ratios

#

Well, you are doing unnecessary things thrre, I can say that

stiff anvil
slate swan
stiff anvil
#

I don't understand it

#

Why is it printing 97

slate swan
slate swan
lyric tusk
slate swan
#

pfp = Image.open(avatar_data)

lyric tusk
stiff anvil
#
@client.event
async def on_message(message):
    if fuzz.token_sort_ratio("who asked") in str(message.content).lower():
        await message.reply("I asked.")
#

Tell me this works!

#

Wait... it wont

#

Answer me!

sick birch
south jetty
#
@client.command()
async def accept(ctx, self):
    accept_req = await self.cso.post(
        url=f"https://friends.roblox.com/v1/users/{self.id}/accept-friend-request"
    )
    return accept_req.status == 200```
quaint epoch
#

this server is filled to the brim with bots

#

just posts a codeblock with no explanation

stiff anvil
#

Bro I need help

#
@client.event
async def on_message(message):
    if fuzz.token_sort_ratio("who asked", f"{in str(message.content).lower())}":
        await message.reply("I asked.")
#

please help!

#

!pip fuzzywuzzy

unkempt canyonBOT
sick birch
stiff anvil
#

I don't know how I do it for a discord bot

#

token_sort_ratio takes 2 arguments

sick birch
#

Same way as it’s in the pypi page

maiden fable
#

U do know that difflib exists, right?

sick birch
#

Difflib is another alternative yea

maiden fable
#

And it's also a stdlib

stiff anvil
#

why tf does it spam?

#

@sick birch

#
async def on_message(message):
    if fuzz.token_sort_ratio("who asked", message.content):
        await message.reply("Your Mom?")
#

I did this

wispy spade
#

The bot is probably just listening to itself

maiden fable
#

add this to the top

#
if message.author.bot:
    return
wispy spade
stiff anvil
slate swan
maiden fable
#

Yea same thing

maiden fable
slate swan
#

yea just 2 lines less

slate swan
maiden fable
stiff anvil
#

I use

#

client instead of bot

slate swan
#

then use bot

#

no problem

stiff anvil
#

It works!

#

Let's see if my friend can bypass it

#

Excuse me?

willow raptor
#

Your mom?

stiff anvil
torn sail
#

@stiff anvil

maiden fable
#

?

stiff anvil
torn sail
#

Check if the number that the method returns is in a certain range

stiff anvil
#

how do I print the number tho?

#

I know why it's happening!

#

no I dont...

torn sail
#

Don’t. Just use … in range (int threshold)

stiff anvil
torn sail
#

Ur checking if the number returned is in a certain range

swift imp
#

Help pls(20 syntax error)py @bot.command() async def casino(ctx, arg): cash = collection.find_one({"member_id": ctx.author.id, "guild_id": ctx.guild.id})["money"] if arg is numbers: if cash >= arg: money = arg if random.randint(0, 100) > 50: bal = collection.find_one({"member_id": ctx.author.id, "guild_id": ctx.guild.id})["money"] + money embed = discord.Embed(title="", description=f"""Ты получил {money} bebr Твой баланс {bal}""", colour=0x843DA4) await ctx.send(embed = embed) collection.update_one({"member_id": ctx.author.id, "guild_id": ctx.guild.id},{"$inc": {"money": money}}) else: bal = collection.find_one({"member_id": ctx.author.id, "guild_id": ctx.guild.id})["money"] - money emb = discord.Embed(title="", description=f"""Ты потерял {money} bebr Твой баланс {bal}""", colour=0x843DA4) await ctx.send(embed = emb) collection.update_one({"member_id": ctx.author.id, "guild_id": ctx.guild.id},{"$inc": {"money": money}}) else: await ctx.send(f"Бот, у тебя нету денег") else: await ctx.send(f"Бот, впиши число")
This is casino

stiff anvil
#

???

torn sail
south jetty
mental bison
#

Also properly indent your code

stiff anvil
#

HELLLLLLLLLLLLLLLLLLLLLLP

mental bison
#

Where you expecting bot to reply differently?

stiff anvil
#

Please read my older messages

stiff anvil
#
@client.event
async def on_message(message):
    if message.author.bot:
        return
    if fuzz.ratio("who asked", message.content) in range(100):
        await message.reply("Your Mom?")

Current code

wispy spade
# stiff anvil

await bot.process_commands(msg) right at the end of your event

wispy spade
torn sail
stiff anvil
#
@client.event
async def on_message(message):
    if message.author.bot:
        return
    if fuzz.ratio("who asked", message.content) in range(0, 100):
        await message.reply("Your Mom?")
        await bot.process_commands(message)
#

So like this?

wispy spade
#

nvm

torn sail
#

If it’s 0 any message will trigger it

wispy spade
stiff anvil
#

50 then

keen talon
stiff anvil
#

I JUST NEED IT TO WORK FIRST

torn sail
swift imp
stiff anvil
mental bison
#

you have indentation problems

wispy spade
swift imp
#

I tried to correct the tabulation or something like that, but it didn't work.

stiff anvil
#

Is this motherfucking bot dumb or something?

#

I'm dying 😂

wispy spade
#

try a higher value

left crater
torn sail
stiff anvil
#

50,100

torn sail
#

Hmm

quaint epoch
#

lower it one tab

stiff anvil
#

Commands dont work

quaint epoch
stiff anvil
slate swan
#
import disnake
from disnake.ext import commands
from disnake.utils import get

class Test(commands.Cog):

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

    @commands.Cog.listener()
    async def on_guild_join(self, ctx):
        print('test')
        msg = "This is a test message."
        try:
            channel = get(ctx.guild.channels, name="general")
            await channel.send(msg)
        except:
            try:
                await ctx.guild.system_channel.send(msg)
            except:
                return

def setup(client):
    client.add_cog(Test(client))
quaint epoch
#
@client.event
async def on_message(message):
    if message.author.bot:
        return
    if fuzz.ratio("who asked", message.content) in range(0, 100):
        await message.reply("Your Mom?")
    await bot.process_commands(message)```
quaint epoch
stiff anvil
#

commands are back to working

quaint epoch
#

not a context object

stiff anvil
#

And we have this...

#
@client.event
async def on_message(message):
    if message.author.bot:
        return
    if fuzz.ratio("who asked", message.content) in range(50, 100):
        await message.reply("Your Mom?")
    await client.process_commands(message)

Current code

slate swan
#

what is the write way?

mental bison
#
@bot.command()
async def casino(ctx, arg):
    cash = collection.find_one({"member_id": ctx.author.id, "guild_id": ctx.guild.id})["money"]
    if arg is numbers:
        if cash >= arg:
         money = arg

    if random.randint(0, 100) > 50:
        bal = collection.find_one({"member_id": ctx.author.id, "guild_id": ctx.guild.id})["money"] + money
        embed = discord.Embed(title="", description=f"""Ты получил {money} bebrТвой баланс {bal}""", colour=0x843DA4)
        await ctx.send(embed = embed)
        collection.update_one({"member_id": ctx.author.id, "guild_id": ctx.guild.id},{"$inc": {"money": money}})

    else:
        bal = collection.find_one({"member_id": ctx.author.id, "guild_id": ctx.guild.id})["money"] - money
        emb = discord.Embed(title="", description=f"""Ты потерял {money} bebrТвой баланс {bal}""", colour=0x843DA4)
        await ctx.send(embed = emb)
        collection.update_one({"member_id": ctx.author.id, "guild_id": ctx.guild.id},{"$inc": {"money": money}})   

    else:
        await ctx.send(f"Бот, у тебя нету денег")

    else:
        await ctx.send(f"Бот, впиши число")

Try this and show me the ouput error

quaint epoch
#
import disnake
from disnake.ext import commands
from disnake.utils import get

class Test(commands.Cog):

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

    @commands.Cog.listener()
    async def on_guild_join(self, guild):
        print('test')
        msg = "This is a test message."
        try:
            channel = get(guild.channels, name="general")
            await channel.send(msg)
        except:
            try:
                await guild.system_channel.send(msg)
            except:
                return

def setup(client):
    client.add_cog(Test(client))```
torn sail
stiff anvil
#

what's disnake?!

stiff anvil
quaint epoch
mental bison
wispy spade
mental bison
torn sail
stiff anvil
#
@client.event
async def on_message(message):
    print(fuzz.ratio(args))
torn sail
#

But the arguments in the brackets of fuzz.ratio

stiff anvil
#
@client.event
async def on_message(message):
    print(fuzz.ratio(message.content))
#

So this?

#
@client.event
async def on_message(message):
    print(fuzz.ratio("who asked", message.content))

No this

torn sail
#

Yep

quaint epoch
#

wait your using discord.Client() not Bot?

torn sail
#

He’s using bot

#

Just named it client

quaint epoch
torn sail
#

Lol yeah

daring olive
#

hey all

quaint epoch
stiff anvil
#

100
69

#

It's because

slate swan
daring olive
#

i am mina LaserKeypora how are you all today

stiff anvil
#

I have to change the 100 to 101 I guess

quaint epoch
#

(this isn't the minaberry i know)

daring olive
#

why wdym?

quaint epoch
stiff anvil
#

@torn sail :)

mental bison
daring olive
#

ah yes changed it recently. just wanted to pop in and say hi

torn sail
wispy spade
torn sail
stiff anvil
#

Thank you so much!!!

torn sail
daring olive
#

lol is that a bot feature?

#

i need that

mental bison
quaint epoch
stiff anvil
#

I'm selling the code (no one helped me here) for $100

daring olive
quaint epoch
#

!rule 9

unkempt canyonBOT
#

9. Do not offer or ask for paid work of any kind.

stiff anvil
quaint epoch
#

idk if this is related i post it when ever i see the $ symbol

daring olive
mental bison
stiff anvil
daring olive
#

check out our #rules we have 9 :)

wispy spade
slate swan
mental bison
stiff anvil
#
@client.event
async def on_message(message):
    print(fuzz.ratio("who asked", message.content))
    if message.author.bot:
        return
    if fuzz.ratio("who asked", message.content) in range(50, 101):
        await message.reply("I asked.")
mental bison
stiff anvil
#

And this is what it does

quaint epoch
#

guess that works too

vocal snow
quaint epoch
#

uhhh

quaint epoch
#

guys, why did i just get an option to ping all admins

#

when i pressed @

#

is it bug

slate swan
mental bison
quaint epoch
#

yeah lets go with that

vocal snow
slate swan
vocal snow
#

I think type, description, name etc, not all of them required

quaint epoch
vocal snow
quaint epoch
#

back to moderating my class server

#

cya

vocal snow
quaint epoch
slate swan
slate swan
vocal snow
#

Ah I see

swift imp
#

i wass fix cod to 3 errorpy @bot.command() async def casino(ctx, arg): cash = collection.find_one({"member_id": ctx.author.id, "guild_id": ctx.guild.id})["money"] if arg is numbers: if cash >= arg: money = arg if random.randint(0, 100) > 50: bal = collection.find_one({"member_id": ctx.author.id, "guild_id": ctx.guild.id})["money"] + money embed = discord.Embed(title="", description=f"""Ты получил {money} bebr Твой баланс {bal}""", colour=0x843DA4) await ctx.send(embed = embed) collection.update_one({"member_id": ctx.author.id, "guild_id": ctx.guild.id},{"$inc": {"money": money}}) else: bal = collection.find_one({"member_id": ctx.author.id, "guild_id": ctx.guild.id})["money"] - money emb = discord.Embed(title="", description=f"""Ты потерял {money} bebr Твой баланс {bal}""", colour=0x843DA4) await ctx.send(embed = emb) collection.update_one({"member_id": ctx.author.id, "guild_id": ctx.guild.id},{"$inc": {"money": money}}) else: await ctx.send(f"Бот, у тебя нету денег") else: await ctx.send(f"Бот, впиши число")

#

@mental bison

cold sonnet
#

indents are a joke

slate swan
#

bad indentation attacks

cold sonnet
#

indents overrated

swift imp
austere herald
#

Pymongo is blocking

swift imp
#

A

#

How fix?

white perch
#

Why does this not work? await Member.remove_roles([role.id for role in entry.user.roles])

File "C:\Users\USER\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\member.py", line 995, in remove_roles
    await req(guild_id, user_id, role.id, reason=reason)
AttributeError: 'list' object has no attribute 'id'```
stiff anvil
quick gust
stiff anvil
#

Damn 😂

white perch
#

i want to remove ALL existing roles of a person

stiff anvil
white perch
#

Uh not that

#

You can remove multiple roles at once right

quick gust
unkempt canyonBOT
#

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

These roles are sorted by their position in the role hierarchy.
quick gust
#

!d discord.Member.remove_roles()

unkempt canyonBOT
#

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

Removes [`Role`](https://discordpy.readthedocs.io/en/master/api.html#discord.Role "discord.Role")s from this member.

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, and the removed [`Role`](https://discordpy.readthedocs.io/en/master/api.html#discord.Role "discord.Role")s must appear lower in the list of roles than the highest role of the member.
quick gust
#

or actually, no need for the loop

white perch
#

Ye exactly

stiff anvil
#

I guess so

quick gust
#

yep

white perch
#

you can remove all at once

slate swan
#

does anyone know a discord api for getting server id

quick gust
stiff anvil
#

They do the same tho :D

white perch
#

but how do you do that

#

im not really sure what abc.Snowflake is

stiff anvil
#

And you might get an error tho

#

If the bot can't remove a certain role

#

You will need a loop to handle that.

white perch
#

you mean the default role and integrated roles?

stiff anvil
#

No

#

A role higher than the bot's role

white perch
#

ah right

stiff anvil
#

:)

placid skiff
#

!d disnake.abc.Snowflake

unkempt canyonBOT
#

class disnake.abc.Snowflake```
An ABC that details the common operations on a Discord model.

Almost all [Discord models](https://docs.disnake.dev/en/latest/api.html#discord-api-models) meet this abstract base class.

If you want to create a snowflake on your own, consider using [`Object`](https://docs.disnake.dev/en/latest/api.html#disnake.Object "disnake.Object").
sick birch
white perch
#

Oh

slate swan
#

can anybody help me

stiff anvil
maiden fable
#

Indeed. It is just an abstract class which does

class Snowflake:
    def __init__(self, id):
        self.id = id
maiden fable
#

errors?

placid skiff
maiden fable
swift imp
vocal snow
white perch
#

btw can discord bots timeout an admin

maiden fable
placid skiff
slate swan
#

does anyone know a discord api for getting server id

maiden fable
white perch
slate swan
white perch
#

oh okay thanks

maiden fable
#

Yea u can

honest vessel
placid skiff
vocal snow
slate swan
#

i can't find it anywhere

placid skiff
#

bro discord api are public .-.

vocal snow
slate swan
swift imp
placid skiff
vocal snow
placid skiff
#

what do you mean for "a discord api for it"

swift imp
honest vessel
#

🧠

slate swan
slate swan
honest vessel
slate swan
vocal snow
white perch
#

@honest vessel@maiden fable i got missing perms when i try to timeout someone py discord.errors.Forbidden: 403 Forbidden (error code: 50013): Missing Permissions

maiden fable
#

!d disnake.Permissions.moderate_members is what u need

white perch
unkempt canyonBOT
slate swan
maiden fable
#

That is their wish

vocal snow
white perch
#

im using pycord

wispy spade
slate swan
maiden fable
#

I just saw the error and it said discord.errors, so thought they are using dpy

wispy spade
#

or pycord

maiden fable
#

Never used that

slate swan
maiden fable
#

Oh well

slate swan
#

they dont even rename the package

wispy spade
vocal snow
maiden fable
#

Then I will keep mum

white perch
white perch
#

it's not

slate swan
#

whom did you try to timeout?

#

if it was u, it wont work

white perch
#

im trying to timeout my alt whose highest role is admin

maiden fable
#

And what perms does it have?

slate swan
#

oh, and how about the bot's permissions?

maiden fable
#

The alt

white perch
#

it has admin permissions

maiden fable
#

Ha

#

You cannot timeout someone with admin perms czzzzz they are admin perms

#

Administrator permission bypasses everything iirc

vocal snow
white perch
#

all the bots have administrator

maiden fable
#

And yr alt?

white perch
wispy spade
maiden fable
vocal snow
#

Why? It's perfectly normal for a fork to use the same namespace

slate swan
vocal snow
#

Take Pillow, fork of PIL for example

wispy spade
slate swan
slate swan
maiden fable
vocal snow
slate swan
wispy spade
maiden fable
white perch
#

true

slate swan
slate swan
maiden fable
#

Its fine, happens

vocal snow
honest vessel
slate swan
maiden fable
honest vessel
#

owner > all

maiden fable
maiden fable
vivid marsh
honest vessel
#

yes

#

thats what i have

maiden fable
unkempt canyonBOT
#

await create_guild(*, name, region=<VoiceRegion.us_west: 'us-west'>, icon=..., code=...)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).

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

Bot accounts in more than 10 guilds are not allowed to create guilds.
slate swan
maiden fable
#

Tho only bots in less than 10 guilds can do

vivid marsh
#

Jeez lol

honest vessel
#

private bot and 1 server so

vivid marsh
#

Ahh that’s pretty cool tho

slate swan
#

region=<VoiceRegion.us_west: 'us-west'> why is this still there, isnt that feature removed?

honest vessel
slate swan
#

mhm, the bot is synced with master branch tho
maybe it was affected after shutdown

maiden fable
#

Huh

#

Smh my head

slate swan
#

shaking my head my head

slate swan
unkempt canyonBOT
#

The region for the voice channel’s voice communication. A value of None indicates automatic voice region detection.

New in version 1.7.

maiden fable
#

Yea that

honest vessel
#

!d discord.VoiceRegion

unkempt canyonBOT
#

class discord.VoiceRegion```
Specifies the region a voice server belongs to.
honest vessel
#

!d discord.Guild.region

unkempt canyonBOT
#

The region the guild belongs on. There is a chance that the region will be a str if the value is not recognised by the enumerator.

honest vessel
#

but last time i tried it i still think it changed? :S

#

or maybe i changed to command changing server region (useful sometimes when ur area is lagging)

slate swan
#

is that right

honest vessel
#

@exotic kiteno one will help u

#

!ToS

unkempt canyonBOT
#
Did you mean ...

» microsoft-build-tools
» tools
» off-topic-names

exotic kite
honest vessel
#

!Rules

unkempt canyonBOT
#

The rules and guidelines that apply to this community can be found on our rules page. We expect all members of the community to have read and understood these.

wispy spade
#

and technically no one can

exotic kite
#

ig

wispy spade
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)
exotic kite
#

i mean they were doing it in discord.js server so

#

i thought maybe, anyways ty

honest vessel
#

this isnt discord.js server?

exotic kite
#

if u cant help, and if its not allowed then tell me

honest vessel
#

i did

exotic kite
#

then shut up now?

stiff anvil
#

How can I handle character spams for example if someone says oooooooooooooooo they should get a warning

honest vessel
#

maybe remove spaces and go throu letters, if next letter is repeated and count how many repeating if more than X (your choice) send a warningn delete msg

#

or go word by word and letter by letter in each word

stiff anvil
#

ummmm

#

Are you sure it's gonna work?

#

And I need an example code

exotic kite
#

!rules

unkempt canyonBOT
#

The rules and guidelines that apply to this community can be found on our rules page. We expect all members of the community to have read and understood these.

stiff anvil
manic wing
tidal hawk
#

is there a way to get CategoryChannel without using other chanels?

stiff anvil
#

wtf? since when

#

AND THERE IS NO RULE ABOUT SPOONFEEDING

manic wing
#

there doesnt have to be a rule; we just dont do it

exotic kite
#

wth, earlier someone was being rude to me about this shit. nobody told them this

stiff anvil
#

Because they didn't continue...

manic wing
#

if you dont want to make a discord bot by yourself without being pushed the entire way, dont make one.

stiff anvil
slate swan
#

anyone know the docs for the button thingies

#

wdym

#

do you know what the button thingies are called

#

not really, buttons are same for all forks

honest vessel
#

@stiff anvil ```py
string = "this is aaaaaaaaaaa message"

def test_words(message):
for word in string.split(" "):
temp_l=""
i=0
max_i = 5
for l in word:
if i >= max_i:
return "Too many chars!"
if l == temp_l:
i += 1
temp_l = l
print(i)

print(test_words(string))

placid skiff
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.
placid skiff
slate swan
#

examples?

#

is pycord good?

#

no.

slate swan
#

well its personal preferences, im not a fork fan but i prefer disnake

manic wing
#

there is a long list

placid skiff
honest vessel
#

!forks

unkempt canyonBOT
#
Did you mean ...

» string-formatting
» for-else

manic wing
#
disnake | hikari [personal preference]
pincer
rin
edpy
discord.py
pycord
nextcord```
#

top to bottom

#

is it not?

#

whelp

slate swan
#

what does it not have

honest vessel
#

a good name

#

for a discord fork

manic wing
#

hikari isn’t a fork

honest vessel
#

oh

#

thought u listed forks

manic wing
#

i listed libraries

slate swan
#

thats why discord.py users find it weird cause it dont fit to their syntax

honest vessel
manic wing
#

meh threads are irrelevant

vocal snow
#

Rin is the best, no doubt

slate swan
#

true, there's a pr tho

manic wing
vocal snow
#

Yes, of course

slate swan
#

🏃‍♂️ the model rewrite is still missing a message object , hope andy completes it soon

vocal snow
#

He is too busy drinking coffee

lone aurora
#

msg = await client.wait_for('message', check=check) AttributeError: module 'discord.client' has no attribute 'wait_for' eh

#

what did i do now ;-;

vocal snow
#

You imported client from discord

lone aurora
#

yes

vocal snow
stiff anvil
#
async def on_message(message):
    for word in message.content.split(" "):
        temp_l=""
        i=0
        max_i = 5
        for l in word:
            if i >= max_i:
                print("1")
            if l == temp_l:
                i += 1
            temp_l = l
            await message.reply("Stop spamming characters...")
#

@honest vessel

lone aurora
manic wing
slate swan
stiff anvil
vocal snow
slate swan
#

Uh

stiff anvil
#

I want it so, If they spam characters, They should get a reply

slate swan
#

Perhaps where you warn the user? Idk, it's your app, use some logic and conduct it how you want to

honest vessel
stiff anvil
honest vessel
#

just add return infront of await

slate swan
#

How can't you figure this out?

stiff anvil
#

im dumb

honest vessel
#

no your just newbie

stiff anvil
#

Bruh

honest vessel
#

do as i say, add return infront of await

stiff anvil
#
@client.event
async def on_message(message):
    for word in message.content.split(" "):
        temp_l=""
        i=0
        max_i = 5
        for l in word:
            if i >= max_i:
                print("1")
            if l == temp_l:
                i += 1
            temp_l = l
            return await message.reply("Stop spamming characters...")
honest vessel
#

yes

stiff anvil
#

I did this tho

honest vessel
#

but u doing it wrong again

stiff anvil
#

bruh

honest vessel
#

return await message.reply("Stop spamming characters...") is at wrong place

stiff anvil
#

Yes, And you should've told me earlier 😢

honest vessel
#

you changed the code

#

print("1") replace with return await message.reply("Stop spamming characters...")

stiff anvil
#

tysm ❤️

honest vessel
stiff anvil
manic wing
#

i think personally discord will make a system for all moderation due to the amount of nitro scams and shit like that - so personally, no

stiff anvil
#

imo yes

cunning ice
#

where to get a list of all commands related to making a discord bot in python ?

#

pls tell

manic wing
#
  • there are hundreds of moderation bots, make something unique
honest vessel
#

you cant sia what discord-devs gonna do or not, so why not make it it wont take that much effort either way

manic wing
honest vessel
#

warnings are just -> insert into db row

cunning ice
honest vessel
#

I dont think discord will ever implament warning system for all

slate swan
#

How so?

manic wing
#

well you get ratelimited shitless cycling through audit logs + you would have to store/cache a lot of data

honest vessel
#

maybe you are overthinking a warning-system

cunning ice
#

any answers ?

manic wing
#

ratelimits:

manic wing
slate swan
#

Audit logs are not a good resource, especially if your goal is to create a public bot

honest vessel
slate swan
#

So inserting a simple document into the database is not efficient?

#

Ah then you will probably be fine, although I don't know what the ratelimits are like

manic wing
slate swan
#

What would be the error code command for when the author is not the owner?

manic wing
unkempt canyonBOT
#
I'm sorry Dave, I'm afraid I can't do that.

No documentation found for the requested symbol.

manic wing
#

ugh now i gotta find it

quick gust
#

!d discord.ext.commands.is_owner

unkempt canyonBOT
#

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

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

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

@is_owner() and add owner_id= to ur bot-construction?

manic wing
#

!d discord.ext.commands.NotOwner

unkempt canyonBOT
#

exception discord.ext.commands.NotOwner(message=None, *args)```
Exception raised when the message author is not the owner of the bot.

This inherits from [`CheckFailure`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.CheckFailure "discord.ext.commands.CheckFailure")
peak loom
#

I have discord.ui installed but it won't work.

manic wing
quick gust
manic wing
slate swan
manic wing
#

idk whatever tf you installed

honest vessel
peak loom
peak loom
honest vessel
#

ok

manic wing
#

@honest vessel this is why ^

slate swan
#

can you run python3 -m discord -v

honest vessel
manic wing
#

not discord

slate swan
#

The package name is discord

peak loom
quaint epoch
#

why it ain't showing info on disnake

cold sonnet
#

!pypi disnake

unkempt canyonBOT
quaint epoch
#

oh alr

slate swan
manic wing
quaint epoch
#

!pypi discord

unkempt canyonBOT
honest vessel
#
- Python v3.9.1-final
- discord.py v1.6.0-final
- aiohttp v3.7.3
- system info: Linux 4.9.0-14-amd64 #1 SMP Debian 4.9.246-2 (2020-12-17)
``` caeden wrong again
quick gust
#

discord is a mirror package

manic wing
#

but if you do pip install discord you install some whack module

quick gust
#

discord.py isn't

manic wing
#

!pypi discord

unkempt canyonBOT
quaint epoch
unkempt canyonBOT
manic wing
#

oh?

quaint epoch
#

why are there two

quick gust
#

yeah

manic wing
#

they changed discord

honest vessel
#

i dont use it 😄

quick gust
quaint epoch
manic wing
#

discord was originally some random module

honest vessel
#
neo@hck:~$ python3 -m discord.py -v
/usr/local/bin/python3: No module named discord.py
quaint epoch
#

py -m pip install discord is what i did

slate swan
#

Yeah so install the master branch. Do python3 -m pip install git+https://github.com/Rapptz/discord.py@master

honest vessel
#

install disnake!

#

u will need to change later or sooner anyway

quick gust
peak loom
slate swan
#

I don't care, you don't need to tell me that.

quick gust
#

lmao

quaint epoch
#

!source docs

unkempt canyonBOT
#
Command: docs

Look up documentation for Python symbols.

Source Code
cold sonnet
#

nah

#

this server's got far more moderation

quaint epoch
cold sonnet
#

unlucky

red nest
#

true

quick gust
#

agreed

slate swan
#

I'm toxic? My bad lol, I don't care.

manic wing
#

imagine being toxic

quick gust
#

there's always some argument

honest vessel
slate swan
manic wing
#

timtoy on smoke rn

slate swan
#

is it possible to make a giveaway bot with those buttons

sick birch
#

Guys let’s tone it down a bit

manic wing
manic wing
sick birch
#

Oops

manic wing
#

the sky's the limit

slate swan
quaint epoch
#

does it bug anyone else when one part of your code displays data as a list, and another part displays the same data as a tuple?

sick birch
maiden fable
#

I bet this is the first time I am not part of a heated argument

quaint epoch
static epoch
#

Remember to ping @ Moderator when things get... heated up

honest vessel
#

damn any reason buttons only can have 5 in row?

#

i wish it was 6...

#

6x6

static epoch
honest vessel
#

i mean i just want a button with a letter in it so should be small

manic wing
honest vessel
#

was thinking of making a wordle game but i guess i will use emojis

#

does this server has the new games that are oout?

little fulcrum
#

ayo dudes

static epoch
#

you mean things like Chess? I don't think so, but not sure

honest vessel
#

Yeah the new pokernights etc

little fulcrum
#

im having some problems with my discord bot

honest vessel
#

@little fulcrumu dont need to tell us that, just post code ask for help and with errors if any

manic wing
#

i just stole it

honest vessel
#

but wordle is 6x6

little fulcrum
#
import discord

TOKEN = "nope you're not getting my token"

client = discord.Client()

@client.event
async def on_ready():
    print("{0.user} is now online!".format(client))

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

    if message.content.startswith('!hello'):
        await message.channel.send('Hello there!')

client.run(TOKEN)
manic wing
#

why use buttons

honest vessel
#

buttons can ondly do 5x5

#

ah yeah skrew the buttons 😉

little fulcrum
#

when i do !hello it doesnt say "hello there!"

honest vessel
#

@manic wingi dont mind share my ideas its notlike u stealing my money bro

little fulcrum
#

and yes i did give it permission to send messages

honest vessel
#

if u want i can dm u my shitty code so far

manic wing
little fulcrum
#

oh ty

#

imma try that

south brook
little fulcrum
south brook
#

That just works fine

left crater
#

channel = bot.get_channel(numbers)

south brook
#

where do i put that

left crater
maiden fable
#

They are, yes

left crater
#

id should not be a string

hoary cargo
#

5 rows, 5 columns

south brook
left crater
#

put ur channel id inside the parenthesis

south brook
#

with or withour "

maiden fable
#

without

south brook
#

ok

little fulcrum
slate swan
#

also, dont use discord.Client, commands.Bot is preferred for making commands

left crater
red nest
little fulcrum
slate swan
little fulcrum
slate swan
#

ext is a folder inside the discord package, its not another library

south brook
# left crater ik

i get this PException: 400 Bad Request (error code: 50035): Invalid Form Body
In channel_id: Value "hallway" is not snowflake.

left crater
#

ik

#

he has not imported it

red nest
little fulcrum
#

like when i type !hello it doesnt say "hello there!"

slate swan
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.
little fulcrum
#

i did

slate swan
#

and, use functions to create the commands.

little fulcrum
#

ye i just watched a video yesterday on it

#

yes

shrewd inlet
#
@bot.command()
async def image(ctx):
  async with aiofiles.open('/path/to/file', mode='r') as f:
    contents = await f.read()
  embed = discord.Embed(color=0x2f3136)
  embed.set_image(url=random.choice(gracieimgs.txt))
  await ctx.send(embed=embed)
little fulcrum
#

yes it doest

#

it prints: Bingus Bot#0841 is now online!

lament depotBOT
little fulcrum
#

it just doesnt send messages

#

even though it has permission

#

and yes it is in my server

left crater
#

yeah...

little fulcrum
#

like killing the terminal and re running it?

left crater
#

yes

little fulcrum
#

still not sending

#

yes

#

no caps

#

i did !hello not "hello" or ?hello

#

yes

#

3.10.0

#

im using VSC

#

idk i just did "pip install discord" in the terminal

slate swan
little fulcrum
little fulcrum
#

ohh

#

someone sent "use wait_for"

#

so i did that

slate swan
#

pithink Client

little fulcrum
#

lesss go it works nowww

#

ty

slate swan
#

But....Client

little fulcrum
#

yeah i just got into it yesterday

slate swan
#

Not helpful but alright

peak loom
#

I can't fix this. I have it.

little fulcrum
#

watched a 5 minute indian video

maiden fable
quick gust
maiden fable
#

You don't

slate swan
#

make commands using Client uwu

quick gust
# peak loom

No, as you can see here, your dpy version is 1.7.3

cold sonnet
#

help

slate swan
cold sonnet
#

you said uwu

peak loom
slate swan
maiden fable
peak loom
quick gust
slate swan
maiden fable
quick gust
#

you can curse but don't be hostile, that's toxicity then

peak loom
slate swan
left crater
#

bored people

cold sonnet
#

I'm gonna have a one-week vacation next week and I'm gonna do everything that is possible in a discord bot

maiden fable
#

BTW @pliant gulch rate my shitty command parser:

        signature_of_cmd = signature(command_function)
        msg_without_cmd = split(msg)
        del msg_without_cmd[0]
        params.append(Context(self, message))
        num_of_args = (
            len(signature_of_cmd.parameters) - 2
        )  # 3 because 2 for required args and for the last kwarg
        args_in_the_message = msg_without_cmd[:num_of_args]
        kwargs_in_the_message = [join(msg_without_cmd[num_of_args:])]
        params = params + args_in_the_message + kwargs_in_the_message
        kwargs_to_be_passed = {
            parameter.name: argument
            for parameter, argument in zip(signature_of_cmd.parameters.values(), params)
        }
        await command_function(
            **kwargs_to_be_passed
        )

And yea, don't ask me what I have done in this since I myself don't understand it now

hoary cargo
cold sonnet
#

I'm not like all people

rare saddle
#

Please tell me how can I make a bot with support for different languages using Internationalization ?

cold sonnet
#

I'm meh dpy coder

hoary cargo
#

ye meh

cold sonnet
#

I'm gonna change it to pro and change it back as soon as I say something stupid

maiden fable
cold sonnet
#

me gonna have a nickname for 2 hours and then it's gone

hoary cargo
maiden fable
#

Me still waiting to get motivation to work on HunAI again

cold sonnet
maiden fable
hoary cargo
cold sonnet
#

fix your bot, bot

maiden fable
cold sonnet
#

no

slate swan
hoary cargo
#

i kinda want to make an opensource custom moderation bot MR_uncanny_1

maiden fable
little fulcrum
maiden fable
#

Not a reason to start its deving again

little fulcrum
#

i tried using .split to remove the command but it gave me an error

cold sonnet
#

hope intensifies

slate swan
slate swan
maiden fable
#

You both gonna take this to an ot channel yourself or....

cold sonnet
slate swan
#

ash teaching how to get girls?

maiden fable
#

!ot

unkempt canyonBOT
cold sonnet
#

hope decreases

slate swan
#

👁️ 👁️

cold sonnet
#

back homie

slate swan
unkempt canyonBOT
#

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

cold sonnet
#

ash never gonna be cool

slate swan
#

man leave me alone😔

maiden fable
#

Weren't u the only one who started it? Ashley

slate swan
#

yup

slate swan
#

you still are👁️ 👁️

slate swan
#

bro

hoary cargo
maiden fable
#

!ot @hoary cargo @slate swan

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

Suggest more topics here!

maiden fable
cold sonnet
slate swan
#

👁️ 👁️

quaint epoch
#

i hate this new pycharm update

maiden fable
slate swan
#

sublime better

#

😳

hoary cargo
left crater
#

pycharm forever the best

cold sonnet
sick birch
#

Either way very let’s keep it on topic

maiden fable
#

!ot anyways

unkempt canyonBOT
slate swan
maiden fable
#

Ok

slate swan
#

yes theres a channel to apply

#

just dm robin😌

sick birch
#

Im good

neat pagoda
maiden fable
#

Can we stop being ot now?

sick birch
#

Please

south brook
#

Invalid Form Body
In channel_id: Value "MYCHANNELSAME" is not snowflake.

#

help me ik get this error

sick birch
#

Can we see the code?

south brook
#

ye

hoary cargo
# sick birch There is none

i was ironic the channel stays most of the time on topic, just because sometimes there are some side chitchat i find it quite normal for those who are regulars here and mainly help people, so imo it's useless drama caused for few ot words lol

stiff anvil
#

Anyone wanna try bypassing my who asked filter?

#

msg me if you wanna try

maiden fable
#

DM me the invite

slate swan
#

seems funny

stiff anvil
stiff anvil
peak loom
#

I get this error when I try to remove my react to remove to my role. (Code is attached)

left crater
south brook
peak loom
stiff anvil
maiden fable
slate swan
#

Are the gets even coros?

maiden fable
#

the remove_role is

sage otter
#

remove_roles is a coro

slate swan
south brook
sick birch
slate swan
sick birch
#

Also I suggest use the buttons that discord.py provides for you instead of a 3rd party library

stiff anvil
sick birch
#

I'm okay, thanks :p

stiff anvil
#

okay :D

south brook
#

But the code is just in there

sick birch
#

And so, which line is the error in?

south brook
#

it doesnt say that

sick birch
#

Can you provide the full traceback?

south brook
#

wdym?

sick birch
#

The entire traceback error

#

Not just a snippet of it

south brook
#

is this good?

slate swan
#

well it needs a snowflake

#

an id which is an int which None was given

sick birch
#

discord.Object(id) to make your own snowflake

spring flax
#

Anyone used allowed mentions to none()?
I tried it right now but it on mobile, for the users, it just shows invalid-user

south brook
#

wdym?

spring flax
#

!d discord.Object

unkempt canyonBOT
#

class discord.Object(id)```
Represents a generic Discord object.

The purpose of this class is to allow you to create ‘miniature’ versions of data classes if you want to pass in just an ID. Most functions that take in a specific data class with an ID can also take in this class as a substitute instead. Note that even though this is the case, not all objects (if any) actually inherit from this class.

There are also some cases where some websocket events are received in [strange order](https://github.com/Rapptz/discord.py/issues/21) and when such events happened you would receive this class rather than the actual data class. These cases are extremely rare.

x == y Checks if two objects are equal.

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

hash(x) Returns the object’s hash.
south brook
#

so i do channel = discord.Object(ID)

spring flax
#

what is your code right now?

south brook
#

dont look at the rest

rare saddle
#

Please tell me how can I make a bot with support for different languages using Internationalization ? Cogs | Disnake | Discord

south brook
#

No

spring flax
#

that seems like a nuke bot

#

I'd rather not help you sorry

south brook
#

no, please it isnt

#

i can explain every single line

spring flax
#

!rule 5

unkempt canyonBOT
#

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

south brook
#

that isnt it

#

What part looks like nuke?

spring flax
#

i mean I saw that you have purge(limit=a high number) put several times so I think it's a fair reason to believe what you're doing isn't appropriate

south brook
#

I can explain

slate swan
#

👀

south brook
#

I just wanted to clear a whole channel

#

And i have multiple of them

slate swan
#

delete the channel?

spring flax
#

especially under a setup command...weird

south brook
red sundial
#

weird

slate swan
unkempt canyonBOT
#

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

Deletes the channel.

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

raven you forgot to remove the ()

south brook
#

I will make that but only if you help me

slate swan
spring flax
#

yeah i realised lol

south brook
#

But i swear on everything this isnt a nuke

spring flax
slate swan
south brook
#

But can someone please tell the answer to my error?

spring flax
slate swan
#

the method returns all fields to False

spring flax
maiden fable
#

Ah

#

It is an embed?

slate swan
spring flax
#

expected behaviour?

slate swan
maiden fable
#

That is a known issue in mobiles

spring flax
maiden fable
slate swan
#

yeah sometimes mobile clients have that issue which they never display like they never cached it

spring flax
#

i made it send in a message with allowed_mentions.none() because if i put embed, msot users won't show

#

but that is not an embed, a normal member ping

slate swan
#

yeah its not your fault

maiden fable
slate swan
#

when a member isnt cached it will show as an invalid-user

spring flax
maiden fable
#

Nope

spring flax
#

well, no alternatives then

#

going back to embeds

slate swan
south brook
#

Everyone ignores meeeee

slate swan
south brook
#

hi

#

Can you gimme the answer to this

hoary cargo
#

MR_canny_meh_stage your code looks too sus that's why

south brook
south brook
slate swan
south brook
#

ye

slate swan
#

it needs a snowflake

#

which is an id of the channel which is an int

south brook
#

a snowflake

#

bot.get_channel(❄️) like this?

south brook
cold sonnet
#

huh

slate swan
slate swan
south brook
#

ok

slate swan
#

a solid number

south brook
#

but an example?

cold sonnet
#

is he trolling rn?

slate swan
quaint epoch
#

do embeds have a a char limit? bc regular messages is like 1-2k or smth

south brook
#

thats what i have

south brook
quaint epoch
quaint epoch
south brook
#

ow

slate swan
slate swan
#

!d discord.ext.commands.Bot.get_channel

unkempt canyonBOT
quaint epoch
#

what's the normal message limit, if embed descriptions are 4096, what are normal messages?

south brook
#

What should i do then?

quaint epoch
#

nice, so embeds have more without nitro

#

thanks

slate swan
#

yw

south brook
#

so i dont know

quaint epoch
#

how about discord.Guild.get_channel

south brook
#

testing

slate swan
#

its the same thing

south brook
#

ow

slate swan
#

it doesnt work because youre entering NoneType

south brook
#

not testing anymore lol

south brook
slate swan
#

if the id is wrong the method returns None

south brook