#discord-bots

1 messages · Page 690 of 1

heavy folio
#

???

boreal ravine
#

yep

heavy folio
#

i understood nothimg from this

tawdry perch
#

I think you need to use global

faint monolith
heavy folio
#

im not.

boreal ravine
fading tiger
#

helo

faint monolith
#

Create a server and add Probot on it.
probot.io

heavy folio
#

it will list the slash commands your bot has wdym...

boreal ravine
tawdry perch
#

!e ```py
b = 1
class Foo:
def bar():
return b + 1
print(Foo.bar())

unkempt canyonBOT
#

@tawdry perch :white_check_mark: Your eval job has completed with return code 0.

2
faint monolith
sullen shoal
#

why not use the class for the variables? thats the advantage of using classes

tawdry perch
#

hm

faint monolith
heavy folio
#

firstly @faint monolith did u even load your cog where the slashes are in

heavy folio
heavy folio
#

next u on dpy?

boreal ravine
faint monolith
#

???

tawdry perch
#
  @disnake.ui.button(label=b)
  async def c(self, bu, i):
  #  await i.response.defer()
    global b
    b += 1
    self.edit()
``` @boreal ravine, is the error on the which line if it is here
sullen shoal
faint monolith
heavy folio
#

what

#

are you on dpy

faint monolith
heavy folio
#

tf

heavy folio
#

💀

#

are u on dpy? yes yes, python

faint monolith
boreal ravine
tawdry perch
faint monolith
heavy folio
#

yeah??

fading tiger
#

so I want to make a discord bot to play any text I search "not URL!!"(well maybe later) to play music from YouTube can someone help .. I tried tuts on YT ( 😅 ) but they are very confusing methods ... I tried something tho

faint monolith
#

YES

heavy folio
#

now show your code

boreal ravine
sullen shoal
boreal ravine
#

hm

faint monolith
#

Here could happen a sonami

heavy folio
#

what

slate swan
#

am I allowed to collect data like server owner names and server's names

faint monolith
#

With 100 of codes

heavy folio
#

!d discord.Guild use the owner and name atrribute

unkempt canyonBOT
#

class discord.Guild```
Represents a Discord guild.

This is referred to as a “server” in the official Discord UI.

x == y Checks if two guilds are equal.

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

hash(x) Returns the guild’s hash.

str(x) Returns the guild’s name.
heavy folio
heavy folio
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.

tawdry perch
#

and if you talk about user names, you can surely store them

heavy folio
#

oh the server must be in the guild yeah

faint monolith
#

Thanks

heavy folio
#

uh what

sullen shoal
slate swan
tawdry perch
slate swan
#

hm

boreal ravine
#

but myxi that isnt the problem, im ok with using a variable in the main scope the problem is that im getting a nameerror for no reason

sullen shoal
#

namerror?

boreal ravine
#

yes

sullen shoal
#

show the traceback

valid barn
#

check that makes sure user has manage message perms before running commands

sullen shoal
#

dont tell me you dont have one because thats not how humans debug

faint monolith
faint monolith
boreal ravine
tawdry perch
#

interesting

sullen shoal
faint monolith
sullen shoal
#

also that can be easily be fixed by setting that an attr of the View subclass

faint monolith
sullen shoal
#

theres no point of using globals inside a method

tawdry perch
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)
sullen shoal
#

actually globals are often times useless

tawdry perch
#

we will not help with music bots

boreal ravine
tawdry perch
#

can't you just have self.b = 1 and edit it?

sullen shoal
#

global it before the first definition

boreal ravine
#

hm

sullen shoal
#

!e

def func():
    hi = 1
    class H():
        def hi(self):
            global hi
            print(hi)
    H().hi()
func()```
unkempt canyonBOT
#

@sullen shoal :x: Your eval job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "<string>", line 8, in <module>
003 |   File "<string>", line 7, in func
004 |   File "<string>", line 6, in hi
005 | NameError: name 'hi' is not defined
boreal ravine
#

o

#

thanks

sullen shoal
#

!e

def func():
    global hi
    hi = 1
    class H():
        def hi(self):
            #global hi
            print(hi)
    H().hi()
func()```
unkempt canyonBOT
#

@sullen shoal :white_check_mark: Your eval job has completed with return code 0.

1
boreal ravine
#

hm

tawdry perch
sullen shoal
#

thats what kayle is doing

tawdry perch
#

oh

boreal ravine
#

ah it worked

#

but it isnt editing the button

sullen shoal
#

as i said you gotta subclass ui.Button and use View.add_item

#

global is not the solution

boreal ravine
#

hm

valid barn
#

how to get all the servers that both the user and bot are in (mutual servers)

sullen shoal
#

also if it is, you should never be proud of that code

boreal ravine
#

that got removed in 1.7 iirc

tawdry perch
#

you just asked that question, be patient

tawdry perch
unkempt canyonBOT
#

property mutual_guilds: List[Guild]```
The guilds that the user shares with the client.

Note

This will only return mutual guilds within the client’s internal cache.

New in version 1.7.
valid barn
valid barn
tawdry perch
#

try reading the docs first

#

also it seems to just return a list of guild that a user is in so maybe you just pass user obj + that mutual_guilds thing

boreal ravine
tawdry perch
#

hm?

boreal ravine
#

seems bad since it only gives cached guilds

sullen shoal
#

you gotta fetch the member then

#

or user

velvet tinsel
#

Hi all

boreal ravine
#

that'd work? it says guilds in the cache not the member

sullen shoal
#

i dont think fetching guild will have every member's member object tho

slate swan
#

does anyone have a ruby extention for visual studio code

unkempt canyonBOT
sullen shoal
tawdry perch
#

hmm could be, just came up with ot because of ruby

valid barn
#

how to check if a message was sent in dms (using if and on_message event)

@client.event
async def on_message(message):
  if message.guild == None:
    #some stuff

⬆️ doesnt work

slate swan
#
if isinstance(message.channel , discord.DMChannel): ```
valid barn
#

how to check that the bot is not the one that sent the message (using if)

slate swan
#

you can just compare message.author with client.user

sullen shoal
#

though, you can just ignore bots completely by checking if discord.Member.bot is True

#

return if its True

tawdry perch
#

makes the code return if the message was sent in guild

valid barn
tawdry perch
#

oh I just noticed you had a answer alrd 😅, well gl!

valid barn
tawdry perch
#

uh

#

me neither, I just found the docs

valid barn
#

oh

pure field
#

how to make these kinds of messages

tawdry perch
#

ephernal iirc, works for slash commands

pure field
#

one only the author can see

tawdry perch
#

!d discord.abc.Messageable.send

#

hm not here

pure field
#

hmm

manic wing
tawdry perch
#

oh

#

I always get it wrong smh

pure field
#

whats ephemeral

slate swan
# pure field how to make these kinds of messages

ephemeral messages, they work with any kind of interactions, here is the breakdown of "interactions"

    views:
        buttons
        dropdowns
        etc
    application_commands:
        slash_commands
        user_commands
        message_commands
slate swan
pure field
#

mhm

tawdry perch
#

you just add ephemeral=True to that interaction when you send it and it should work

south thicket
#

Friends, suggest me some free hosting that I can upload my bot

#

without heroku*

pure field
#

have you tried using uptimerobot

minor panther
grand shell
#

hey guys. im trying to host my discord bot 24/7. whats the best way to do this? thanks :))

minor panther
#

For the first time heroku would be fine

grand shell
#

is it difficult to do?

slate swan
#

Need help if my bot dont have presnece intent and i want to use this code

intents = discord.Intents.all()
intents.members = True

How to use this

maiden fable
#

!d discord.TextChannel.set_permissions

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...
maiden fable
#

Yups pass None to overwrites kwarg

pure field
# grand shell hey guys. im trying to host my discord bot 24/7. whats the best way to do this? ...
freeCodeCamp.org

This tutorial will show you how to build your own Discord bot completely in the cloud. You do not need to install anything on your computer, and you do not need to pay anything to host your bot. We are going to use a number of tools, including the Discord

maiden fable
#

@sullen shoal 👀

sullen shoal
#

oh damn another guy getting ruined

grand shell
#

thx

sullen shoal
#

please dont

#

its bad and outdated

grand shell
#

lmao

slate swan
#

Need help if my bot dont have presnece intent and i want to use this code

intents = discord.Intents.all()
intents.members = True

How to use this

grand shell
#

iv already made the bot in pycharm and it would be so long to get it all on repl properly

grand shell
sullen shoal
grand shell
sullen shoal
#

wait a min i think ik smth that could help

sullen shoal
# grand shell haha i think i need to do some research
-> step 1: make a git repo with all of your bot files

-> step 2: go to your heroku account, create a new app (located in US, will get your average bot latency to under 30ms 100% of the time)

-> step 3: go to settings and add python buildpack, then click "Reveal Config Vars" and add your bot token, along with whatever you have in your .env there

-> step 4: go to deploy, select Github, connect your github account, then select your bot's repo

-> step 5: make sure your bot has a `Procfile` which has "worker: python main.py" (or whatever the file that runs your bot is) and a requirements.txt where you have your requirements listed in newlines

-> step 6: go to overview, click Configure Dynos and then click that pencil icon and toggle the button then click Confirm

-> step 7: make sure you have 2 heroku accounts and switch between them at the end of each month (when you get an email from heroku saying that you're running out of dynos, they refresh at the start of each month)

-> step 8: done

thanks to @slate swan

boreal ravine
#

or just use railway, its like heroku but its unlimited and free

slate swan
#

how do i make a discord bot make a channel

maiden fable
#

!d discord.Guild.create_text_channel

unkempt canyonBOT
#

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

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

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

The `overwrites` parameter can be used to create a ‘secret’ channel upon creation. This parameter expects a [`dict`](https://docs.python.org/3/library/stdtypes.html#dict "(in Python v3.9)") of overwrites with the target (either 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")) as the key and a [`PermissionOverwrite`](https://discordpy.readthedocs.io/en/master/api.html#discord.PermissionOverwrite "discord.PermissionOverwrite") as the value.

Note

Creating a channel of a specified position will not update the position of other channels to follow suit. A follow-up call to [`edit()`](https://discordpy.readthedocs.io/en/master/api.html#discord.TextChannel.edit "discord.TextChannel.edit") will be required to update the position of the channel in the channel list...
dawn vine
#

can only 1 on_message be there?

maiden fable
#

u can also do guild.create_voice_channel and so on

maiden fable
slate swan
#

str(len(guild.members)) gives only 1 member for some reason

dawn vine
slate nymph
#

is anybody familiar with danny's asqlite?

maiden fable
unkempt canyonBOT
#

Using intents in discord.py

Intents are a feature of Discord that tells the gateway exactly which events to send your bot. By default, discord.py has all intents enabled, except for the Members and Presences intents, which are needed for events such as on_member and to get members' statuses.

To enable one of these intents, you need to first go to the Discord developer portal, then to the bot page of your bot's application. Scroll down to the Privileged Gateway Intents section, then enable the intents that you need.

Next, in your bot you need to set the intents you want to connect with in the bot's constructor using the intents keyword argument, like this:

from discord import Intents
from discord.ext import commands

intents = Intents.default()
intents.members = True

bot = commands.Bot(command_prefix="!", intents=intents)

For more info about using intents, see the discord.py docs on intents, and for general information about them, see the Discord developer documentation on intents.

maiden fable
slate nymph
#

nice, I am a complete beginner to databases and i needed to know how to connect my bot to sqlite3

maiden fable
#

smh Python bot

#

!d sqlite3.connect

unkempt canyonBOT
#

sqlite3.connect(database[, timeout, detect_types, isolation_level, check_same_thread, factory, cached_statements, uri])```
Opens a connection to the SQLite database file *database*. By default returns a [`Connection`](https://docs.python.org/3/library/sqlite3.html#sqlite3.Connection "sqlite3.Connection") object, unless a custom *factory* is given.

*database* is a [path-like object](https://docs.python.org/3/glossary.html#term-path-like-object) giving the pathname (absolute or relative to the current working directory) of the database file to be opened. You can use `":memory:"` to open a database connection to a database that resides in RAM instead of on disk.

When a database is accessed by multiple connections, and one of the processes modifies the database, the SQLite database is locked until that transaction is committed. The *timeout* parameter specifies how long the connection should wait for the lock to go away until raising an exception. The default for the timeout parameter is 5.0 (five seconds).
maiden fable
#

There

slate nymph
#

this is sqlite3 ig

maiden fable
#

asqlite is just await in front of sqlite3

slate nymph
#

isnt asqlite different from sqlite3 package?

slate swan
slate nymph
#

ic thanks

maiden fable
#

!d discord.PermissionOverwrite

unkempt canyonBOT
#

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

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

The values supported by this are the same as [`Permissions`](https://discordpy.readthedocs.io/en/master/api.html#discord.Permissions "discord.Permissions") with the added possibility of it being set to `None`.

x == y Checks if two overwrites are equal.

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

iter(x) Returns an iterator of `(perm, value)` pairs. This allows it to be, for example, constructed as a dict or a list of pairs. Note that aliases are not shown.
slate nymph
#

i still dont get it lmao

#

where should i connect it

maiden fable
slate swan
#
    for guild in client.guilds:
        text_channel_list = []
        for channel in guild.text_channels:
            text_channel_list.append(channel)
            file = open("guild"+str(guild.id), "w")
            file.write("Name: "+str(guild)+"\nOwner: "+str(guild.owner)+"\nMembers: "+str(len(guild.members))+"\nChannels: "+str(text_channel_list))

would this be against the ToS? (collecting server info)

slate nymph
maiden fable
#

your .db file

slate swan
#

Why use asqlite

#

ah ko

maiden fable
slate swan
#

Like its not even maintained well as aiosqlite

#

how do I get the server owner's name and tag not id?

#

cuz guild.owner_id gives

maiden fable
slate swan
#

!pypi aiosqlite

unkempt canyonBOT
slate nymph
#

ah

slate swan
maiden fable
unkempt canyonBOT
#

property owner: Optional[discord.member.Member]```
The member that owns the guild.
slate nymph
#

k

maiden fable
unkempt canyonBOT
#

property name```
Equivalent to [`User.name`](https://discordpy.readthedocs.io/en/master/api.html#discord.User.name "discord.User.name")
maiden fable
#

there

slate swan
#

These danny simps smh

#

I love danny but jeez

maiden fable
#

Lmao well I don't really care whatever they are using since there ain't much changes in sqlite3 anyways

slate swan
slate nymph
#

just trying stuff

slate swan
#

Try aiosqlite lol

slate nymph
#

k

slate swan
#

Better maintained

slate nymph
#

ok but how do i connect?

slate swan
#

Check their docs

slate nymph
#

k

slate swan
#

Should be in the pypi page

dense coral
#

!hel[

maiden fable
#

Hmm

slate swan
#

Even I do

wary ice
#
Ignoring exception in on_message
Traceback (most recent call last):
  File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\client.py", line 343, in _run_event
    await coro(*args, **kwargs)
  File "c:\Users\user\OneDrive\Υπολογιστής\Bots\main.py", line 224, in on_message
    users = json.load(f)
  File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\json\__init__.py", line 293, in load
    return loads(fp.read(),
  File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\json\__init__.py", line 346, in loads
    return _default_decoder.decode(s)
  File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\json\decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\json\decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)``` this error code level up why
maiden fable
#

Anyways add {} in the file

wary ice
#

json?

maiden fable
#

yea

wary ice
#
    
}``` here ?
maiden fable
#

that is your JSON file?

wary ice
#

yes

maiden fable
#

weird, the error says the file is empty

wary ice
#
{
    
}``` users.json file this ?
maiden fable
#

Yea

#

that should be the file

wary ice
#

wait

#
Ignoring exception in on_message
Traceback (most recent call last):
  File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\client.py", line 343, in _run_event
    await coro(*args, **kwargs)
  File "c:\Users\user\OneDrive\Υπολογιστής\Bots\main.py", line 228, in on_message
    await level_up(users, message.author, message.channl)
AttributeError: 'Message' object has no attribute 'channl'
Ignoring exception in on_message
Traceback (most recent call last):
  File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\client.py", line 343, in _run_event
    await coro(*args, **kwargs)
  File "c:\Users\user\OneDrive\Υπολογιστής\Bots\main.py", line 228, in on_message
    await level_up(users, message.author, message.channl)
AttributeError: 'Message' object has no attribute 'channl'``` new error
grand shell
#

hey guys, i used github and heroku to host my bot but its still offline.. does anyone know any troubleshooting things i can try?

wary ice
#

where i put it?

slate swan
wary ice
#

json ?

grand shell
#

nope no errors

slate swan
#

line 228 of your code

wary ice
#

wait

#

yes

grand shell
#

my only idea is that maybe my requirements are wrong? what exactly should i put in that file?

maiden fable
#

@slate swan u into web development?

wary ice
#

{"728612647423180820": {"experience": 5, "level": 1}, "728612647423180820": {"experience": 5, "level": 1}} this prob for json

#

why ?

maiden fable
#

use discdb tho What is the problem

wary ice
maiden fable
#

wat's the issue

slate swan
wary ice
#

2 probs

maiden fable
#

hover over it and tell the problem

wary ice
#

this?

maiden fable
#

Ah

#

u can see, the two keys are the same

wary ice
#

yes

maiden fable
#

the message IDs are the same, and that is happening twice

#

that isn't allowed in JSON

wary ice
#

and now what do I do?

sullen shoal
raw latch
#

Can someone explain me how can I make one button to run bot.command on_click?

wary ice
slate swan
unkempt canyonBOT
#

get_command(name)```
Get a [`Command`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.Command "discord.ext.commands.Command") from the internal list of commands.

This could also be used as a way to get aliases.

The name could be fully qualified (e.g. `'foo bar'`) will get the subcommand `bar` of the group command `foo`. If a subcommand is not found then `None` is returned just as usual.
maiden fable
#

@slate swan mind helping?

slate swan
maiden fable
#

mhm

slate swan
#

client.owner is not a thing in og discord.py , if you want the command to be usable only by you use @commands.is_owner() check

sullen shoal
#

oh lol

#

i dont think thats gonna work tho

slate swan
#

f , now noone other than you will be able to slap

sullen shoal
#

for that atleast

slate swan
#

just compare the user.id with your id

#

¯_(ツ)_/¯

#

bruh

#
if user.id == 834811249622908988:
  #dont slap me```
#

ive been on vsc for to long

#

jeez

#

lol

sullen shoal
#

!d discord.ext.commands.Bot.owner_id

unkempt canyonBOT
dense coral
#

loll

sullen shoal
#

!d discord.ext.commands.Bot.owner_ids

unkempt canyonBOT
#

The user IDs that owns the bot. This is similar to owner_id. If this is not set and the application is team based, then it is fetched automatically using application_info(). For performance reasons it is recommended to use a set for the collection. You cannot set both owner_id and owner_ids.

New in version 1.3.

slate swan
#

or just use
@is_owner decorator

#

cleaner

#

does the same thing without an if statement

#

they dont want to do that tho

sullen shoal
slate swan
#

weird i would

#

what id are they trying to compare?

#

the bot owner?

sullen shoal
#

user and the bot owner

slate swan
#

then use the dang decorator

#

🚶

sullen shoal
#

it makes the entire command only usable by the command

#

what they're trying to do is to see if the mentioned user is the owner

slate swan
#

why

#

🧍‍♂️

sullen shoal
#

they dont want to get virtually slapped

slate swan
# slate swan why

they want to make something like , if the author mentions someone other than him , bot slaps them
if its him , bot doesnt

#

ah i see

slate swan
#

kindof

sullen shoal
#

i think i would have done smth completely unnecessary to do that

#

using global checks and a list of commands where i dont want the first arg to be me and Context.args

slate swan
#

you did what

sullen shoal
#

the benefit is that i can have multiple commands like that without the if statement in every command where I want it

sullen shoal
slate swan
#

nvm

slate swan
#

or make a custom decorator

sullen shoal
#

idk how that's gonna work

wary ice
#

do u know for level up ?

slate swan
#

avoid dumping data for same ids multiple times

sullen shoal
#

also i think you should do some maths with experience to get the level

slate swan
#

im just doing it from my mind lol

sullen shoal
#

thats not how decorators work

slate swan
#

wdym

#

never done a check so i just did it how i thought lol

sullen shoal
#

decorators are just some easy way to do smth like
decorator(func)
which is same as

@decorator
def func()```
#

another way is to do

def func()
decorator(func)```
slate swan
#

yeah ik

slate swan
sullen shoal
#

a command is just a function so thats gonna error

slate swan
#

so it would be in the commands

@bot.command()
@decorator()
async def commmand():
    ....
slate swan
sullen shoal
#

however if you do,

def decorator():
    async def check(ctx):
        if ctx.author.id == 1234567890:
            return
        else:
            passreturn check```

`ctx` will be the function
#

you cant get Context like that thats it

slate swan
#

ic

#

thougth you could but ig you cant

slim dragon
#

can anyone tell me why this code is not working ???

@bot.event
    async def on_member_join(member):
                
        mbed = discord.Embed(
            title=f'**Welcome!**', 
            description=f'**{hello}**', 
            color=(c.light_grey())
        )
        
        await member.send(embed=mbed)
sullen shoal
#

member.channel isnt a thing

slate swan
#

yeah

#

you would have to get the channel

slim dragon
#

I've changed that, recheck it

#

its only member.send()

sullen shoal
#

whats the error

slim dragon
sullen shoal
#

!intents

unkempt canyonBOT
#

Using intents in discord.py

Intents are a feature of Discord that tells the gateway exactly which events to send your bot. By default, discord.py has all intents enabled, except for the Members and Presences intents, which are needed for events such as on_member and to get members' statuses.

To enable one of these intents, you need to first go to the Discord developer portal, then to the bot page of your bot's application. Scroll down to the Privileged Gateway Intents section, then enable the intents that you need.

Next, in your bot you need to set the intents you want to connect with in the bot's constructor using the intents keyword argument, like this:

from discord import Intents
from discord.ext import commands

intents = Intents.default()
intents.members = True

bot = commands.Bot(command_prefix="!", intents=intents)

For more info about using intents, see the discord.py docs on intents, and for general information about them, see the Discord developer documentation on intents.

sullen shoal
#

on_member_*
doesn't work without members intent

slate swan
#

cant really see the member without it

#

!member.join

#

!member_info

unkempt canyonBOT
#

You are not allowed to use that command here. Please use the #bot-commands channel instead.

slate swan
#

guys, how do I create such a rule, Who clicked on the reaction and he is not the author who called the return command

slim dragon
#

its on_member_join not on_member

sullen shoal
#

* refers to leave and join

#

and other events like that

slim dragon
slate swan
slim dragon
dense coral
#
@bot.event()
channel = channel id
async def on_member_join():
await channel.send(f"{member.mention} join the server!")```
slate swan
#

no spoonfeed zone

thick sigil
#

lol nice code its not even right

sullen shoal
#

be sure to enable them in the dev panel too

slim dragon
slate swan
#

a pain to watch

quick gust
slim dragon
dense coral
#
@bot.event()
async def on_member_join():
await member.send(f"{member.mention} join the server!")```
slate swan
sick birch
thick sigil
#

poor dude

slate swan
#

damn this hurts

sick birch
#

It freaking does

slate swan
#

watching this poor kid trying to spoonfeed but cant

sullen shoal
#

bro someone send help to this guy

#

this guy needs a good python tutorial

slim dragon
slate swan
#

i have home service but the cost is a fee

dense coral
sick birch
#

No duh

quick gust
#

oh my god, I'm out

sick birch
#

Jesus

slate swan
#

this is painful

sick birch
#

It’s disgraceful

slate swan
#

sad

sullen shoal
#

im gonna go and do my shit

slate swan
#

right with you

dense coral
mild raft
#

Does anyone know a simple bot code with a level system?

sage otter
#

Bruh

slate swan
#

no comment

sage otter
#

What the hell is that lmao 😂

slate swan
#

hes tried to spoonfeed like 3 times and has failed

sage otter
slate swan
#

how do I create a check, Who clicked on the reaction to check if he is the author who called the command.????

#

this is a pain

thick sigil
#

yall way too mean to him

slate swan
dense coral
sullen shoal
#

you should help when you yourself know what shit you did

sage otter
mild raft
#

Does anyone know a simple bot code with a level system?

sage otter
#

Aren’t you doing this in a command?

slate swan
sage otter
#

yes

sullen shoal
sage otter
#

Aren’t you doing this in or for a command?

slate swan
#

Just make the bot wait for a reaction

#

If thats what your trying to do

dense coral
#

Who can help me with the welcome message command?

sage otter
slate swan
# sage otter Tell me your intentions.

I need to create a check, Who clicked on the reaction, then check if he is the author who called the command itself if he is not the author, then return. . .

sage otter
#

so this is for a command.

#

!d discord.Client.wait_for

unkempt canyonBOT
#

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

Waits for a WebSocket event to be dispatched.

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

The `timeout` parameter is passed onto [`asyncio.wait_for()`](https://docs.python.org/3/library/asyncio-task.html#asyncio.wait_for "(in Python v3.9)"). By default, it does not timeout. Note that this does propagate the [`asyncio.TimeoutError`](https://docs.python.org/3/library/asyncio-exceptions.html#asyncio.TimeoutError "(in Python v3.9)") for you in case of timeout and is provided for ease of use.

In case the event returns multiple arguments, a [`tuple`](https://docs.python.org/3/library/stdtypes.html#tuple "(in Python v3.9)") containing those arguments is returned instead. Please check the [documentation](https://discordpy.readthedocs.io/en/master/api.html#discord-api-events) for a list of events and their parameters.

This function returns the **first event that meets the requirements**...
sage otter
#

Utilize this.

marble rampart
#

how do i create a voice channel with custom permissions ?

sage otter
#

And do what I said earlier with comparing the command author and the reaction user

mild raft
#

@bot.event
async def on_member_join(member):
with open('users.json', 'r') as f:
users = json.load(f)

await update_data(users, member)

with open('users.json', 'w') as f:
    json.dump(users, f)

@bot.event
async def on_message(message):
if message.author.bot == False:
with open('users.json', 'r') as f:
users = json.load(f)

    await update_data(users, message.author)
    await add_experience(users, message.author, 5)
    await level_up(users, message.author, message)

    with open('users.json', 'w') as f:
        json.dump(users, f)

await bot.process_commands(message)

async def update_data(users, user):
if not f'{user.id}' in users:
users[f'{user.id}'] = {}
users[f'{user.id}']['experience'] = 0
users[f'{user.id}']['level'] = 1

async def add_experience(users, user, exp):
users[f'{user.id}']['experience'] += exp

async def level_up(users, user, message):
with open('levels.json', 'r') as g:
levels = json.load(g)
experience = users[f'{user.id}']['experience']
lvl_start = users[f'{user.id}']['level']
lvl_end = int(experience ** (1 / 4))
if lvl_start < lvl_end:
await message.channel.send(f'{user.mention} has leveled up to level {lvl_end}')
users[f'{user.id}']['level'] = lvl_end

@bot.command()
async def level(ctx, member: discord.Member = None):
if not member:
id = ctx.message.author.id
with open('users.json', 'r') as f:
users = json.load(f)
lvl = users[str(id)]['level']
await ctx.send(f'You are at level {lvl}!')
else:
id = member.id
with open('users.json', 'r') as f:
users = json.load(f)
lvl = users[str(id)]['level']
await ctx.send(f'{member} is at level {lvl}!')

#

it's a level system and it don't works

slate swan
#

so I have this code:

for member_role in member.roles:
  print(member_role)

and it prints this

@everyone
R
@everyone
C
C
@everyone
R
Role Bot

but now if I do

for member_role in member.roles:
  if member_role == "R":
    print("Has Role")

it does not print Has role

mild raft
torn sail
#

But which part doesn’t work?

boreal ravine
slate swan
#

so member.roles.names?

#

i mean it printed the name when i did the for loop

#

@tawdry perch search for a role if a user has it, print osmething

boreal ravine
#

member.roles returns a list, lists have no "names" attribute

slate swan
#

How to create a check for on_reaction_add, If the user clicked on the reaction, then check whether he is the author.

#

so why cant i do == if its a list

#

and use a for loop to loop through the list..

boreal ravine
slate swan
#

you did

boreal ravine
#

where

slate swan
#

asss

mild raft
boreal ravine
#

your looping through a members roles which returns a list of discord.Role objects, discord.Role has a name attribute, use that to compare roles with a string

boreal ravine
tawdry perch
#

json as db 😔

tawdry perch
twin moon
#

how often can you use os.chdir

torn sail
slate swan
#

does response count as on_message?

tawdry perch
#

It's a message, so yes

#

Wait

#

What kind of response

slate swan
#

response by bot

tawdry perch
#

If it's a message or smth sent, then yes

slate swan
#

its interaction.send

#

with button

tawdry perch
#

Uh don't know, never tried

slate swan
#

I have it so bot sends this on click ```py
await interaction.send(content=message.content+" | Suggestion accepted by "+str(interaction.author), ephemeral=False, delete_after=30)

and then on_message ```py
        if "accepted" in message.content:

which the message does, then it send a message to another channel

#

cuz apperently you cant send a message on button click to another channel

#

ah its working now

full lily
#

t

slate swan
#

next problem here::

        if message.content in "accepted":
            for guild in client.guilds:
                for channel in guild.channels:
                    if str(channel) == "💡┃suggestion-results":
                        embed = discord.Embed(title="Suggestion Accepted", description=message.content, color=0xFF000)
                        await channel.send(content=None, embed=embed)
                        break

only send "Suggestion Accepted", doesn't send the description, which is message.content

magic ore
#

If substring in string

#

Accepted seems to be the substring here

slate swan
#

huh

upbeat otter
slate swan
#

idk

#

I just like doing it like that, but thats not the problem

#

the problem is that it doesn't send the description=message.content

#

I even tried debugging with
print(message.content)
and it doesn't print anything

paper burrow
slate swan
#

Then fetch it

#

huh

#

Wrong reply

snow flare
#

how can I make a timeout after any function or command is used?

quick gust
#

cooldown?

snow flare
#

that's what I meant

quick gust
#

!d discord.ext.commands.cooldown

unkempt canyonBOT
#

@discord.ext.commands.cooldown(rate, per, type=discord.ext.commands.BucketType.default)```
A decorator that adds a cooldown to a [`Command`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.Command "discord.ext.commands.Command")

A cooldown allows a command to only be used a specific amount of times in a specific time frame. These cooldowns can be based either on a per-guild, per-channel, per-user, per-role or global basis. Denoted by the third argument of `type` which must be of enum type [`BucketType`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.BucketType "discord.ext.commands.BucketType").

If a cooldown is triggered, then [`CommandOnCooldown`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.CommandOnCooldown "discord.ext.commands.CommandOnCooldown") is triggered in [`on_command_error()`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.discord.ext.commands.on_command_error "discord.discord.ext.commands.on_command_error") and the local error handler.

A command can only have a single cooldown.
snow flare
#

thanks

quick gust
#

np

slate swan
#

does it have an announcement when given role?

sage otter
#

Do you mean event?

slate swan
#

ys

#

sry for my bad english

sage otter
#

Yeah it dispatches on_member_update

slate swan
#

but how can i do it on a specified role?

lost wolf
#
    @commands.command()
    async def botinfo(self, ctx):
        developers = "Keref"
        
        embed = discord.Embed(title="Botinfo")
        embed.add_field(name="Server Count", value = f"{self.bot.guilds}")
        await ctx.send(embed = embed)
lost wolf
#

alright

slate swan
sage otter
#

When a specific role is given?

slate swan
#

yes

sage otter
#

Just make logical checks.

lost wolf
#

thanks lol i forgot about len

sage otter
#

Check if the role you want to check for is in after.roles

slate swan
#

ty

lost wolf
#

hey, how can i make it so if someone has a "Beta Tester" role in my bots support server it will print their name under the "Beta tester" field.

sage otter
#

!d discord.Role.members

unkempt canyonBOT
lost wolf
#

huh i would need a example of that please

sage otter
#

Grab the role object and use that attribute?

#
print(discord.utils.get(SomeGuildObj.roles, name="Beta Tester").members)
#

Something like that.

snow flare
#

how can I set a cooldown after a button has been pressed?

lost wolf
sage otter
#

I thought you wanted their names?

lost wolf
#

do i not need len?

sage otter
#

So why you doing len then?

#

len() returns the length of an iterable.

lost wolf
#

oh

#

do i use

from discord.ext import utils
``` to define utils?
sage otter
#

Yes

lost wolf
#

alright

sage otter
#

and instead of discord.utils it would just be utils.get

lost wolf
#

do i have to change the "SomeGuildObj" to my guild id?

sage otter
#

No it’s supposed to be the actual object of your guild that has that role.

lost wolf
#

oh

cold sonnet
lost wolf
cold sonnet
#

why would he import it from discord.ext

sage otter
#

Oh shit. Didn’t notice that AMshrug

cold sonnet
snow flare
#

How can I make a cooldown for a user after he has clicked a certain button

sage otter
#

it’s just
from discord import utils then

lost wolf
sage otter
# lost wolf

Why are you actually copying my examples verbatim

cold sonnet
#

don't know what that means

#

but it sounds inappropriate

sage otter
#

???

#

Are you referring to verbatim ?

cold sonnet
#

yes lmao

sage otter
#

No……

lost wolf
#

im confused af

sage otter
#

It just means "the exact same" some people will use verbatim instead of "word for word" sometimes

cold sonnet
#

oh

#

and it really does

slim dragon
#

can anyone tell me how to get the channel name

lost wolf
#
utils.get(Guild.roles, name="Beta Tester").members)
sage otter
lost wolf
sage otter
#

It’s a thing for Voice, Text, Category, Threads, etc

slim dragon
lost wolf
sage otter
#

Dude please.

slim dragon
#

for example a member messaged hello in general channel. then who to store the channel name in a variable through our bot

#

get(mesg.channel)

snow flare
#

Is there any way to set a cooldown on a button?

slim dragon
boreal ravine
sage otter
#

It’s an example. to show where his actual guild object is supposed to be.

#

PEP8 doesn’t care that much.

sage otter
slate swan
#

i have a question

#

how can i remove the normal $help and make my own

#

like remove that

#

because if i try making a normal $help its broken

sage otter
#

In your bot constructor do
help_command=None

slate swan
#

its python

sage otter
#

????????????

vague grove
#

why does this not work?

    member = client.get_user(826965853156147230)
    await member.edit(nick="test")

I get the error AttributeError: 'User' object has no attribute 'edit'

cold sonnet
#

AttributeError: 'User' object has no attribute 'edit'

#

Member does

#

client.get_member

vague grove
#

ohhhhh

#

thank you

sage otter
cold sonnet
#

oh wait

sage otter
#

!d discord.Guild.get_member

unkempt canyonBOT
cold sonnet
#

right

vague grove
#

yeah i got an error

cold sonnet
#

yeah it doesn't 😦

vague grove
#

its cool

#

thanks fo the help, solved my problem

sage otter
cold sonnet
sage otter
#

Right.

lost wolf
#

discord.ext.commands.errors.CommandInvokeError: Command raised an exception: TypeError: Expected discord.Colour, int, or Embed.Empty but received method instead.

sage otter
#

Show code.

lost wolf
#

code:

    @commands.command()
    async def help(self, ctx):
        embed = discord.Embed(title="NeoBot Premium Commands", color=discord.Color.blurple)
        embed.add_field(name="Admin", value="`ban`")
        embed.add_field(name="Misc", value="`botinfo`")
        await ctx.send(embed = embed)

pliant gulch
#

You need to call it, as it's a method

cold sonnet
#

what's blurple

slate swan
#

does it have an if changed role-id is ?

lost wolf
#

oh alright thanks

sage otter
#

Blue and purple

cold sonnet
#

Danny being Danny

vague grove
sage otter
#

Nah it’s a discord thing

cold sonnet
vague grove
#

well itd look cleaner

cold sonnet
#

you can't read a hex code by yourself

#

but a method named after the color

vague grove
#

true

manic wing
slate swan
#
   if changed_role_id == '890329488000209384'``` wheres the problem?
cold sonnet
#

before, after

pliant gulch
#

Just creates a new discord.Colour with the value of that colour

cold sonnet
#

changed_role_id isn't defined

#

replace is with ==

#

missing :

slate swan
cold sonnet
#

you made 4 errors in 2 lines bruhkitty

slate swan
cold sonnet
#

so learn python

#

!resources

unkempt canyonBOT
#
Resources

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

slate swan
cold sonnet
#

we don't know which role you mean

#

the computer won't know it either

slate swan
#

a team role

#

staff*

cold sonnet
#

which you just took

wary ice
#

pls help

cold sonnet
#

well you iterate through the roles of this person

#

and check if that id is any of those roles' id

wary ice
#
@bot.event 
async def on_message(message):
    with open('users.json', 'r') as f:
        users = json.load(f)

    await update_data(users, message.author)
    await add_experience(users, message.author, 5)
    await level_up(users, message.author, message.channel)

    with open('users.json', 'w') as f:
        json.dump(users, f)

async def update_data(users, user):
    if not user.id in users:
        users[user.id] = {}
        users[user.id]['experience'] = 0
        users[user.id]['level'] = 1``` code
#

prob json

harsh abyss
#

Exception ignored in: <function ClientSession.del at 0x000001BAA3878550>
Traceback (most recent call last):
File "C:\Users\astro\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\aiohttp\client.py", line 326, in del
if not self.closed:
File "C:\Users\milky\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\aiohttp\client.py", line 963, in closed
return self._connector is None or self._connector.closed
AttributeError: 'ClientSession' object has no attribute '_connector'
Traceback (most recent call last):
File "c:\Users\milky\code\practice bot\bott.py", line 52, in <module>
response = aiohttp.ClientSession("GET", jokeurl, headers=headers)
TypeError: init() takes 1 positional argument but 3 positional arguments (and 1 keyword-only argument) were given

#

what do i do

#

response = aiohttp.ClientSession("GET", jokeurl, headers=headers)

sage otter
#

Because that’s not how you use aiohttp.

#

get is a method of ClientSession which you can pass in all your arguments and what not into.

#

!d aiohttp.ClientSession.get

unkempt canyonBOT
#

coroutine async-with get(url, *, allow_redirects=True, **kwargs)```
Perform a `GET` request.

In order to modify inner `request` parameters, provide kwargs.
rare saddle
#

How to make the time display as in (de_DE)?

velvet tinsel
#

What module are you using?

rare saddle
velvet tinsel
#

Bruh

#

I said what module

#

Whatever you’re using

#

Date time?

rare saddle
velvet tinsel
#

Ok

#

Or…?

velvet tinsel
#

OK

rare saddle
velvet tinsel
#

Uh…

#

What are ou trying to do there?

rare saddle
#

And it should be like this:

velvet tinsel
#

Alr

#

The stack overflow has the answer

#

All you have to do is value = format_date

lyric moat
#

i keep getting this error

Traceback (most recent call last):
  File "c:\Users\srtpc\OneDrive\Desktop\run dis up\spider.py", line 7, in <module>
    client = commands.Bot(command_prefix = '+')
AttributeError: module 'discord.ext.commands' has no attribute 'Bot'```
slate swan
#

Show code

maiden fable
#

reinstall dpy

slate swan
#

😭

#

How you say it lol

maiden fable
#

pip install -U discord.py

lyric moat
maiden fable
#

mhm

lyric moat
#

done

maiden fable
lyric moat
#

Thanks

slate swan
#

Hello can someone help me with my discord bot, i cant figure out how to add roles to a member when someone has a specific text in their custom status this is my code so far:

@bot.event
async def on_ready():
    await bot.change_presence(status=discord.Status.dnd, activity=discord.Game(name='erci'))
    for guild in bot.guilds:
        for user in guild.members:
            for activity in user.activities:
                if isinstance(activity, discord.CustomActivity):
                    print(activity)
                    if activity == "ercy":
                        picperms = discord.utils.get(user.guild.roles, name="pic")
                        await user.add_roles(picperms)

it doesnt give me any errors
but it doesnt give me the role
either

#

Dont do anything on ready

#

Make a task

south thicket
#

hi

#

i need free hosts support python for my bot

#

without heroku

harsh abyss
#

any help

#

?

maiden fable
#

client.command*

harsh abyss
#

alr ill try it

slate swan
#

is there any way to shorten this code?

string = "hello world"
print(string[::-1][:5][::-1])
maiden fable
harsh abyss
south thicket
#

so no one want help me with a sentence

manic wing
#

!d str.split

unkempt canyonBOT
#

str.split(sep=None, maxsplit=- 1)```
Return a list of the words in the string, using *sep* as the delimiter string. If *maxsplit* is given, at most *maxsplit* splits are done (thus, the list will have at most `maxsplit+1` elements). If *maxsplit* is not specified or `-1`, then there is no limit on the number of splits (all possible splits are made).

If *sep* is given, consecutive delimiters are not grouped together and are deemed to delimit empty strings (for example, `'1,,2'.split(',')` returns `['1', '', '2']`). The *sep* argument may consist of multiple characters (for example, `'1<>2<>3'.split('<>')` returns `['1', '2', '3']`). Splitting an empty string with a specified separator returns `['']`.

For example:
south thicket
#

i need free hosts support python for my bot

#

its just a word

#

i need websites

slate swan
#

Get a vps

harsh abyss
# maiden fable error?

c:; cd 'c:\Users\milky\code'; & 'C:\Users\milky\AppData\Local\Microsoft\WindowsApps\python3.9.exe' 'c:\Users\milky.vscode\extensions\ms-python.python-2021.12.1559732655\pythonFiles\lib\python\debugpy\launcher' '63436' '--' 'c:\Users\milky\code\penis.py'

#

thats what pops up

maiden fable
#

That's the run command

#

It's starting up

harsh abyss
#

its not started tho

#

it just ends right away

manic wing
south thicket
#

heroko do tthat

#

but ihave bug

maiden fable
south thicket
#

in lbrary

#

and i edited it

#

idk how i can upload this lib to heroku

harsh abyss
south thicket
#

edited lib

harsh abyss
#

yeah i dont have a line that says bot.run

maiden fable
#

Its compulsory

#

!d discord.Client.run

unkempt canyonBOT
#

run(*args, **kwargs)```
A blocking call that abstracts away the event loop initialisation from you.

If you want more control over the event loop then this function should not be used. Use [`start()`](https://discordpy.readthedocs.io/en/master/api.html#discord.Client.start "discord.Client.start") coroutine or [`connect()`](https://discordpy.readthedocs.io/en/master/api.html#discord.Client.connect "discord.Client.connect") + [`login()`](https://discordpy.readthedocs.io/en/master/api.html#discord.Client.login "discord.Client.login").

Roughly Equivalent to...
maiden fable
#

Put it at the end

harsh abyss
#

the run thing

#

run(*args, **kwargs)
this

maiden fable
#

No

#

client.run(YOUR_TOKEN) and replace YOUR_TOKEN with the token u get from Discord Dev Portal

harsh abyss
#

okay

#

i have that already

#

ive used the bot before im just adding stuff

coral vessel
#

how to mention role on embed message?

manic wing
unkempt canyonBOT
slate swan
#

fetch the role place into variable, then do variable.mention

maiden fable
slate swan
#
await create_text_channel(name, test, reason=None, category=None, position=1, topic='Hi', slowmode_delay=0, nsfw=false, overwrites=...)

is this correct

#

topic='hi'

tawdry perch
slate swan
#

anything that is None, you dont need within the parameters

#

and nsfw has to be False, not false

slate swan
#
 await create_text_channel(name, test, reason=None, category=None, position=1, topic='Hi', slowmode_delay=0, nsfw=False, overwrites=...)
#

nono, you can leave the None out of speechmarks since it is using bool

#

Bools always start with capital lol

#

and an error will occur since you havent defined overwrites

#

ye i dont understand that part

#

you can leave it out intirely

south thicket
maiden fable
#

ctx.guild, message.guild, both return one

slate swan
#

oh wait yes

slate swan
untold token
cloud dawn
#

@south thicket Could you please ask questions in the right channels? Just because you are making a Discord bot does not mean everything that you do with it id Discord related. We help with modules that speak to the actual Discord API.

I've asked you this yesterday as well.

untold token
#

Lol

#

Exactly

#

Use a help channel

south thicket
#

its about discord hosts

#

why all will eat me

slate swan
#

Host can host anything not only discord bots

untold token
#

Discord host != discord bots or discord API

south thicket
#

-_-

#

guys why dont focus about help people not this stupid things

untold token
#

If you ask here, you will not get any help

south thicket
#

i come here bec i think my qs about discord

#

not anything else

slate swan
#

Well your wrong.

maiden fable
#

Okay long story short, @south thicket look into Railway platform, u can host your bot there and it's free, now everyone take a chill pill

slate swan
#

Or self host like a chad

untold token
south thicket
slate swan
#

hi 🙂

untold token
#

Its similar to heroku

maiden fable
maiden fable
south thicket
untold token
#

I tried it once

slate swan
#

No free host is good tbh

south thicket
#

so cant use it

south thicket
cloud dawn
south thicket
#

bec my problem

untold token
#

Just take a help channel

south thicket
#

about pafy youtube lib

untold token
#

How hard even is it

south thicket
#

and this server cant help you

slate swan
south thicket
#

about youtube

#

lmao

cloud dawn
untold token
#

If you scrape YouTube then yes

slate swan
#

Pafy uses ytdl

cloud dawn
untold token
#

Its against the rule of this server

slate swan
#
@bot.command(name="test")
async def ping(ctx: commands.Context):
    await create_text_channel(name, test, reason=None, category=None, position=1, topic='Hi', slowmode_delay=0, nsfw=False)
#

!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)
south thicket
#

idc about someone if help me or not i can found the solution with my self

#

i just love speak with others

#

love programming

south thicket
#

like me

untold token
#

Bruh why this channel always gets offtopic

slate swan
#

Were just following rules

slate swan
untold token
#

Yeah

cloud dawn
slate swan
slate swan
untold token
#

!ot

unkempt canyonBOT
south thicket
slate swan
#

Heroku sucks

untold token
#

You won't get any help here

slate swan
#

Use replit

south thicket
slate swan
south thicket
slate swan
#

Replit hosting is horrible

#

Get students plan

south thicket
maiden fable
south thicket
#

replit not for hosting

slate swan
#

Shares ip machines are slow

untold token
#

You need the guild object

slate swan
#

ye ik

untold token
#

ctx.guild returns the guild object

slate swan
#

i was saying is it correct up to that point

untold token
#

and create_text_channel, is Guild method

#

so it would be

slate swan
#

Python slow

#

Node js fast

#

Fight me

cold sonnet
#

@ moderators

slate swan
cold sonnet
#

anyways

#

I'm here to ask

untold token
#
await ctx.guild.create_text_channel(...)
slate swan
#

Node js is the best

slate swan
cold sonnet
#

if there's any option to put role icons

#

in any fork

slate swan
#

Plus if you don’t want your repl.it public make the max username length and make your username with cuss words, slurs, and etc

untold token
#

The hell?

slate swan
#

Don’t post anything either

#

What in the f

#

Bro?

slate swan
# untold token No
@bot.command(name="test")
async def ping(ctx: commands.Context):
    await ctx.guild.create_text_channel(name, test, reason=None, category=None, position=1, topic='Hi', slowmode_delay=0, nsfw=False)

?

slate swan
#

In the username

#

Cp is illegal so don’t post actual cp

cold sonnet
slate swan
#

<@&831776746206265384> this is getting inappropriate

#

why we talking about cp

untold token
#

Exactly lol

slate swan
#

What me get banned

slate swan
#

Sorry

#

But make an inappropriate username for your repl username

cold sonnet
#

just go to an ot channel or to a private channel

slate swan
#

Google search web crawlers won’t pick it up

#

And it will be hidden

cold sonnet
#

there's no place for my overly important questions

#

😦

cold sonnet
#

no code

untold token
#

And what you tryna do?

cold sonnet
#

question

cold sonnet
slate swan
#

🙃

untold token
#

You need to search for that yourself

#

Yes you can set role icons, in disnake (fork) afaik

cold sonnet
#

lesgo

untold token
#

but there are other forks too that probably support that

#

You need to look that for yourself

cold sonnet
#

disnake probably has everything then

arctic python
#

!warn 852448735296356392 Do not bring up inappropriate topics on this server.

unkempt canyonBOT
#

:incoming_envelope: :ok_hand: applied warning to @slate swan.

cold sonnet
#

everyone including hunter says it's better than dpy

untold token
#

Well technically it does

cold sonnet
#

was it hunter? idk
panda for sure

untold token
#

yeah it is better than dpy

#

A lot of changes and good features

cloud dawn
dark vale
#

🙂

slate swan
#

Ok agree

slate swan
dark vale
#

:<

unkempt canyonBOT
untold token
#

test too

dark vale
#

someone help

#

:<

slate swan
untold token
#

@bot.command

tawdry perch
untold token
#

name="foo"

dark vale
sick birch
#

no

#

@bot.command()

untold token
#

Robin already mentioned

untold token
#

Cool

dark vale
slate swan
#
@bot.command(name="hi")
async def ping(ctx: commands.Context):
    await ctx.send("hi all")
    await ctx.send("hi all")
    await ctx.send("hi all")
    await ctx.send("hi all")
    await ctx.send("hi all")
    await ctx.send("hi all")
    await ctx.send("hi all")
    await ctx.send("hi all")

ok this is an example but if i was making my bot send separate messages like this ^
why does it send 4 and then wait and then another 4?

plucky shoal
#

I'm guessing it gets ratelimited

#

@slate swan

slate swan
#

is there a way to make it do it constantly ?

plucky shoal
#

No, being ratelimited means that discord limits the amount of requests you can make

#

You can maybe add a short delay between all the messages so it's consistent

slate swan
#

is there a way i can make a command loop ?

maiden fable
#

Yea it's being ratelimited

plucky shoal
slate swan
dark vale
slate swan
plucky shoal
slate swan
plucky shoal
#

It's not just some lines of code you put in

#

It's a task

#

You need to know how to make one

#

That's why I linked the docs

slate swan
#

ahh

#

never made a task before

plucky shoal
#

That's how tasks look:

@tasks.loop(minutes = 1)
async def my_task() :
  code...
plucky shoal
slate swan
#
import disnake
from disnake.ext import tasks

do i need this

cloud dawn
slate swan
#

ye ik

brittle harness
#

How do I make my bot dm a user that they have been muted once they have?

cloud dawn
#

!d discord.Member.send