#discord-bots
1 messages · Page 1035 of 1
.
replace x with ur intent
I mean he did do what you told him
wdym my intent
This is why I usually use some obscene names, like
intents.PUT_YOUR_INTENTS_HERE
;-;
Just remove intents.x = True and replace default() with all()
Copy pasting in this channel is very prominent
also remove that unused imports
The default one only lacks presences and members so might as well do all of them.
the bot is on but not responding to commands
In production you may wanna only pick the ones you want however
did u changed the x?
It's fine during development, but just keep that in mind
i deleted it
Just no intents.
show
Looks fine to me
@keen mural bot doesnt work with intents and work without it?
which cmd are u using
any erro
no just nothing
try other cmd
i did
works?
??

what you did
Nice
How do i make a group alias?
imagine a bot that simulates the nft market place. Get “nfts” that are on the discord bot for currency you earn through jobs
its same as a normal command alias
if you mean those nfts& currency would be in-bot too, thats easily possible
@unkempt canyon can it be added to servers
@commands.command(name="invites")
async def invites(self, ctx : commands.Context, * , user: disnake.Member=None):
user = ctx.author if not user else user
print(user.name)
for i in await ctx.guild.invites():
print(i.inviter,i)
``` it prints user.name but nothing with for loop
it was working before smh
hm can someone maybe help me in #help-chestnut idk if its that relevant to post here maybe it is idk
No, you can self-host it though but you'd need to change a lot of things since it was designed for this server only
Define "not working"
user = user or ctx.author
that doesn't solve the problem tho :p
???
bruh
alr
fine
@bot.command() async def ping(ctx): await ctx.send('Pong!')
woowww that was my first command :>
This is not working why???
So the command isn't being invoked
it print user.name
the for loop doesnt work
You said it didn't print anything
Can someone help me please?
my bad
Mate, be patient
Ok
the code is correct you might have done something wrong somewhere else
What do you by "not working"? Is there an error? Is the bot not responding?
The bot is not working
I mean it's no responding
remove the * why do u have it there?
um ok ;-;
bumperino
anyone
COPED CODE see that .format
I just copy it on discord.py
You don't need to bring that to light
rename the function from something other than invites because u did name='invites' although im not sure
bro it print user.name inside that function
also thats not the issue
its a discord question i just wasnt sure if i was supposed to ask here or in a help channel cuz i wasnt sure if its more a discord or python relevant question, plus ur not a mod, not gonna get told off by a non mod
@commands.command()
async def invites(ctx, user: disnake.Member=None):
user = ctx.author if not user else user
if user != None:
print(user.name)
for i in await ctx.guild.invites():
print(i.inviter,i)
my all commands are like this
ik i can remove name=""
!d discord.Guild.invites
await invites()```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).
Returns a list of all active instant invites from the guild.
You must have the [`manage_guild`](https://discordpy.readthedocs.io/en/master/api.html#discord.Permissions.manage_guild "discord.Permissions.manage_guild") permission to get
this information.
..
we all start somewhere 
let me know if you need help
The bot is not responding
anyone help me!!
show a screenshot of the console
is it online
Yes
is bot in ur server
the console not the code
Are you running bot or client
tf
replit mobile??
looks like bot
is that a thing
it is a bot
but he is using both
there is no way to be something else
Probably not what he meant
I dont have pc or laptop
he has it defined as bot but is using client
everywhere it says client put bot there instead
yeah
@slate swan help me
@commands.command()
async def invites(ctx, user: disnake.Member=None):
user = ctx.author if not user else user
if user != None:
print(user.name)
for i in await ctx.guild.invites():
print(i.inviter,i)
hey, calm down
bro
i said it print user.name
didnt u read the msg
!silence
✅ silenced current channel for 10 minute(s).
everyone back up like 3 or 4 steps, and take a breath
fwiw, i don't think it's the worst thing to come and say hey i have a channel open in #help-name and to mention briefly what it's about
i wouldn't do it more than once however
bc if you don't get a response chances are the people just aren't online or willing to help at the moment
and it's better to try again later
@lucid vine please don't be rude, if you have any issue with anyone, DM @novel apex
!unshhh
✅ unsilenced current channel.
i wasnt rude i told him to not moderate me in the first place
ok
@slate swanur guild.invites() probably returns an empty list
yeah like i can go 30mins everyone ignores me then i get this guy that helped me completely understand sql for 2 hours+ straight
.. what do i do
ye it get stuck there only
u need to create invites first lmao
if you have any questions, @novel apex. "kid got a broom up his arse" this is rude
im trying on that test server bruh it has invites
come there once..
i said that meaning he is having a fit for nothing
but sure will do next time
and the way you said it was r u d e. but now you know
the timing of the community is dynamic
for example there is definitely a drop in activity during weekends
should be an increase
yea ^
so yes, always try again and during a different time zone
unless the coders touch grass 
no, a lot of people helping help less on weekends
async def on_raw_reaction_add(payload):
ourMessageID = 973433994697904169
if ourMessageID == payload.message_id:
member = payload.member
guild = member.guild
emoji = payload.emoji.name
if emoji == '✅':
role = discord.utils.get(guild.roles, name="Member")
await member.add_roles(role)
# commands
@client.command(pass_context=True)
async def react(ctx):
embed = discord.Embed(
title="Reaction Role",
description='Please click this emoji to get the <@&971970467789418576> role',
timestamp=datetime.now(),
color=0x1abc9c
)
msg = await ctx.send(embed=embed)
await msg.add_reaction('✅')```
There is no errors but the message is not adding the role to the user
If that make sense
First silence since may the second 👀
Does the reaction check condition go through
Wdym?
Like does it pick up a reaction and find it equivalent to the check mark
Oh ye
I don’t know how the default emojis work compared to custom sry
For custom I just take the id
But default don’t have ids I think
Well i mean it does add it to the message but it doesnt add the role to the user
Okie if u did react with the emoji to this msg does the if condition return true?
Like if I clicked the reaction the bot put
Does the condition checking for the reaction say true
If not I would do what krypton said and do str(emoji)
Im not sure how to explain that well since I don’t know the exact terms
still doesnt do anything
Okie
It’s a default emoji
Wait can u get Unicode for default?
i guess so
or the id
show a screenshot of the console traceback
Yes
100%
Also, message content intent isn't in version 1.7.3 (which is the latest version on PyPi)
@slate swan there's no error in console
I back Krypton
Yup
Haha happens
BTW Krypton, u didn't ping Senjan, did u?
Thank you

Rip Senjan 
But @maiden fable
Why event is not working anymore?
What event
bot.event
bot.event he is saying
bot.event deco overrides the default behavior
And the default behavior is to reply to commands automatically
But u made it so that it won't respond to any commands. So, by changing the deco to listen, u just made it so that another listener is added, and the default one isn't touched
Ok cool
Same, but in 2021
Oh, cool!
I have to remove
@bot.listen
async def on_message(message):
if message.author == bot.user:
return
Why
It's like a password for your bot account
!paste
Is it just me or is making bots boring now
Lol
But wouldnt that also apply to just about everything tho?
Your first website. Your first application. Your first anything.
can not confirm
oh
dpy yes it's boring
disnake no its not boring
why disnake no?
making bots with disnake is not boring
not a valid reason
not a valid reason tho
why dpy yes?
same reason as above
I can't really give a different reason as theyre all rooted in I develop for disnake
and that's actually one of the reasons
it's easier when you can add a feature that you want to use for your own bots
hey can anyone say why its not working and it erors when i type
async def on_ready():
await bot.change_presence(status=discord.Status.online, activity=discord.Game(name="m!help"))```
@slate swan
no, not without the error
you need to share the error before you can be helped
works for me
have you defined "bot" ?
they are practically the same thing, one is a copy of the other 🤷♂️
"a copy" is not the right word imo, they use a different logic, especially in the app commands implementation, but it's a fork so most of them will be the same
Why is the save button so high 
Lmao
hello please I set the command prefix as $.
When I type $info, it appears nothing
Could anyone help me
its enjoying itself 
message Isn't defined in the screenshot
Yes but you should rename cmd to ctx for good naming convention
ok thanks lemme try it
The things below @client.event can be done, but when I use $info, it has no reply.
Change event to listen()
Oh it replied. Thanks
What is the difference between these ?
Sorry I'm completely new to Python
The difference is that events are triggered only once, if in your code you will have more events only one of them will be resolved, listeners instead, can be triggered multiple times, that means that multiple listeners can be resolved at the same time
Ok got it. Thank you !
also listeners let you use the on_message event without the need to use the process_command method, so your command will works anyway
Lol

hey can someone teach me how i can build a 8ball cmd for my bot?
dm
like this ---->
!8ball will i get 1milion sub in youtube
and the bot says yes\no random
!d random.choice
random.choice(seq)```
Return a random element from the non-empty sequence *seq*. If *seq* is empty, raises [`IndexError`](https://docs.python.org/3/library/exceptions.html#IndexError "IndexError").
import disnake
import random
from disnake.ext import commands
intents = disnake.Intents.default()
intents.members = True
bot = commands.Bot(command_prefix="!",intents=intents)
@bot.command(name="8ball")
async def s(ctx):
await ctx.reply(random.choice(["yes","no"]))
bot.run(SK2_sd42SDt_RR3ADSF>SFSDs_DDsDAD)

await ctx.send(random.choice(['yes', 'no']))
nope
Hey I try to make a code that checks roles permissions
Who code do you recommend to myself?
Sorry if I make mistakes, I’m Spanish and I don’t speak English like a professional 😅😅😅😅
token...
yes give me ur token ill add
Bruh
1 second
.
Hey @slate swan! I noticed you posted a seemingly valid Discord API token in your message and have removed your message. This means that your token has been compromised. Please change your token immediately at: https://discordapp.com/developers/applications/me
Feel free to re-post it with the token removed. If you believe this was a mistake, please let us know!
Hey @slate swan! I noticed you posted a seemingly valid Discord API token in your message and have removed your message. This means that your token has been compromised. Please change your token immediately at: https://discordapp.com/developers/applications/me
Feel free to re-post it with the token removed. If you believe this was a mistake, please let us know!
Hey @slate swan! I noticed you posted a seemingly valid Discord API token in your message and have removed your message. This means that your token has been compromised. Please change your token immediately at: https://discordapp.com/developers/applications/me
Feel free to re-post it with the token removed. If you believe this was a mistake, please let us know!
Suggest more topics here!
discord programming langauge
OLD topics i hate them
you can submit new ones
that doesnt work
they are help for review and get added
from discord_owner import Ryuga
Ryuga.delete_account(580034015759826944)
Dont u dare its valid syntax
Interesting
discord_owner.py
#inside
class Ryuga():
How can I get my bot to DM a user when the user does the command?
So likepy @client.command async def help(ctx): await ctx.send(f'Here you go!\n{help}')
ctx.author.send
ok
Whats that help inside the f string for
thanks
np
its just a var
dont name it help
alr
name it something else
from typing import Any
from asyncio import run
from discord import User
class Ryuga(User):
def __init__(self, **kwargs: Any) -> None:
super().__init__(**kwargs)
async def delete_account(self) -> None:
await self._connection.http.request(Route('POST', '/user/delete'))
async def main(**kwargs: Any):
ryuga: Ryuga = Ryuga(**kwargs)
await ryuga.delete_account()
run(main(...))
Maybe
okay
who needs random.choice when you could just do list[random.randint(0, len(list)-1)]
:evil:
kj be lurking
typing on phone is fun
from typing import Any
from asyncio import run
from discord import User
class Ryuga(User):
def init(self, **kwargs: Any) -> None:
super().init(**kwargs)
async def delete_account(self) -> None:
await self._connection.http.request(Route('POST', '/user/delete'))
async def main(**kwargs: Any):
ryuga: Ryuga = Ryuga(**kwargs)
await ryuga.delete_account()
run(main(...))
no
Still haven't figured out how to get backticks on my phone's keyboard
`
bruh phones have like a 3 keypads
depends on what keyboard you use
for gboard its just, go to symbols, page 2
gboard is trash
Lol
Simple keyboard is the fastest cuz it loads fast.
u can only use one finger to use that keyboard
Idk what ur talking about
yes
u can use 8 keyboard at a time
u have to use the mouse to interact with that keyboard, and u use one finger to click the mouse
I thought he was talking about mobile
i'm not understanding if you are jokin or smth 
gboard is a keyboard for mobile so idk why he compared it with pc @placid skiff
Lol
im not comparing with pc?
Discord bot is now keyboard channel
That window is from pc
yes?
Tf
where did i compare but?
U use ur mouse to type????
no lol
I mean imp
lmao
It was implied because u said gboard is trash then said that keyboard is best right after
u compared them
i said "best" not "better"
no
anyways
thats still comparing bruh
.topic
bro that was a joke
Source
ping
name
Name?
Sluppy#6431
I think 90% of bot has it
unique
Rpm hydrorico
Control fate
Huh what bot is that
Can it controls my fate?
Maybe
Huh
Google thing
ye in google what
Wdym google what
When you can't find something in google
hey, have you already used app_commands?
!d discord.app_commands.AppCommand
class discord.app_commands.AppCommand```
Represents a application command.
In common parlance this is referred to as a “Slash Command” or a “Context Menu Command”.
New in version 2.0...
i know but not about that
i have problem with sync()
because I am using commands.Bot but there is no documentation on how to specify an application_id
throws a _MissingSentinel exception
Send the error
Bot(application_id=YOUR_BOT_ID)
'_MissingSentinel' object has no attribute 'is_set'
File "J:\BOT\Mucha\bot.py", line 132, in main
await client.tree.sync()
what didnt discord.py die?
For a while yeah
Send the full traceback
this is full xd
damn. So is it back?
Yeah
I remember it stopped when discord introduced slash commands
and I never checked back
are u in discord.py server?
(if they still have one) could u invite me please
Not quite, they were introduced in mid-december 2020 while d.py stopped development in august 2021
!traceback
Please provide the full traceback for your exception in order to help us identify your issue.
While the last line of the error message tells us what kind of error you got,
the full traceback will tell us which line, and other critical information to solve your problem.
Please avoid screenshots so we can copy and paste parts of the message.
A full traceback could look like:
Traceback (most recent call last):
File "my_file.py", line 5, in <module>
add_three("6")
File "my_file.py", line 2, in add_three
a = num + 3
TypeError: can only concatenate str (not "int") to str
If the traceback is long, use our pastebin.
how to fix?
that's what a traceback looks like
We all made it alive
rlly? so i’ve must remembered it wrong
but thanks
client = commands.Bot(
command_prefix=get_prefix, intents=intents,
case_insensitive=True, app_commands=APP_ID)```
like this? because when I do it returns
'_MissingSentinel' object has no attribute 'is_set'
File "J:\BOT\Mucha\bot.py", line 132, in main
await client.tree.sync()
again
change json } [] to ```json
},
full error
that's not the full error
Off-topic channel: #ot2-never-nester’s-nightmare
Please read our off-topic etiquette before participating in conversations.
Don't do that everytime
AttributeError
'_MissingSentinel' object has no attribute 'is_set'
File "J:\BOT\Mucha\bot.py", line 132, in main
await client.tree.sync()
That's all. Nothing more
show me whats near line 132
await client.tree.sync()
No, the thnig thats above/below it
the above exception was caused bby the following...
async def main():
async with client:
await client.tree.sync()
await load_extensions()
await client.start(TOKEN)
asyncio.run(main())
hm
there's an instance of it being used somewhere
im not sure but i dont think you can sync before the bot is even ready?
somewhere in the library code
Show it
maybe I'll check it out
hahah it works, and to think that even the creators of the library could not help me xd
Lol
thanks
He knows the thing better than the creator
the bug was not where you were looking, I already wrote about it with the creators and it's ok
Ok
thanks again
Anyone knows pygame?
Someone need pygame help in #help-pancakes
how to my bot stay alive
stop posting stuff that isnt related to this channel's topic
But #game-development is really ded
really not reasonable
I am trying to code a bot using Python. I am using the discord.py library
So when I try to use the message.reply() function, it doesn't work. What do I do?
@quick ore ^^
In what context do you use it and what errors do you get
I give a command like $reply and it should reply 'Yes'. I did it for a test and it didn't work
Could you show your code
Ok
`import discord
import os
from keep_alive import keep_alive
client = discord.Client()
@client.event
async def on_ready():
print("We have logged in as {0.user}" .format(client))
@client.event
async def on_message(message):
if message.author == client.user:
return
if message.content.startswith('$reply'):
await message.channel.reply('Yes sir.')
if message.content.startswith('$greet'):
await message.channel.send(f'Hello @{message.author}')
if message.content.startswith('$pin'):
await message.pin()
if message.content.startswith('Understood?' or 'understood?'):
await message.channel.send('Yes')
keep_alive()
client.run(os.getenv('bot token'))`
Here
Also yeah don't do commands like this
?????
And don't use replit it will get your bot ratelimited
This is just a test code.
It's for a single server
It's completely wrong test code
I used a tutorial for this code
Lemme bring you a normal tutorial
And don't watch those tutorials on youtube, 80% of them are dumb and outdated
Ok
oh...
I used freecodecamp.org one
Worked well for some commands
others failed
Where is that guide
In youtube
Not that
try message.reply()
and not message.channel.reply()
that is the initial code
I made a mistake there
im trying another method
use commands.Bot btw
don't use discord.Client for making prefix commands
^
ok
and your errors if theres any
Not recommended
we subclass the helpcommand
if you want to remove the help command, in any case, instead of doing bot.remove_command('help'), do
bot = commands.Bot(command_prefix = ..., help_command=None)
@scarlet snow I'm using this tutorial - https://replit.com/talk/learn/How-to-make-a-discord-bot-in-python/37615
Hello, today I will be teaching you how to make a discord bot in python.
First thing you need to do is make a discord bot client ( https://discord.com/developers ) and make a client for your bot there.
Next you need a repl to put all of its code on, so create a 3.8.2 python repl. Next you need to put in the necessary code! B is the import we wi...
follow it
Nice
This is a good tutorial https://vcokltfre.dev/
A tutorial to help you make better Discord bots.
I'll try this too
I'm running the code
`import discord
from discord.ext import commands, tasks
from keep_alive import keep_alive()
import os
key=os.getenv('key')
wkey=os.getenv('wkey')
client = discord.Client()
client = commands.bot(command_prefix="(>)")
client.remove_command('help')
@client.command()
async def command(ctx):
await ctx.send('This command was successful!')
@client.command()
async def help(ctx):
embed = discord.Embed(name="Help", value="help command", color=0xFFFFFF)
await ctx.send(embed=embed)
keep_alive()
client.run(os.getenv('token'))`
This code
@spring flax @scarlet snow What is ctx in the code?
!d discord.ext.commands.Context
class discord.ext.commands.Context(*, message, bot, view, args=..., kwargs=..., prefix=None, command=None, invoked_with=None, invoked_parents=..., invoked_subcommand=None, ...)```
Represents the context in which a command is being invoked under.
This class contains a lot of meta data to help you understand more about
the invocation context. This class is not created manually and is instead
passed around to commands as the first parameter.
This class implements the [`Messageable`](https://discordpy.readthedocs.io/en/master/api.html#discord.abc.Messageable "discord.abc.Messageable") ABC.
the ctx represents the commands.Context.
Actually any argument you place first in a command would be the Context, but ctx is commonly used
!indents
Indentation
Indentation is leading whitespace (spaces and tabs) at the beginning of a line of code. In the case of Python, they are used to determine the grouping of statements.
Spaces should be preferred over tabs. To be clear, this is in reference to the character itself, not the keys on a keyboard. Your editor/IDE should be configured to insert spaces when the TAB key is pressed. The amount of spaces should be a multiple of 4, except optionally in the case of continuation lines.
Example
def foo():
bar = 'baz' # indented one level
if bar == 'baz':
print('ham') # indented two levels
return bar # indented one level
The first line is not indented. The next two lines are indented to be inside of the function definition. They will only run when the function is called. The fourth line is indented to be inside the if statement, and will only run if the if statement evaluates to True. The fifth and last line is like the 2nd and 3rd and will always run when the function is called. It effectively closes the if statement above as no more lines can be inside the if statement below that line.
Indentation is used after:
1. Compound statements (eg. if, while, for, try, with, def, class, and their counterparts)
2. Continuation lines
More Info
1. Indentation style guide
2. Tabs or Spaces?
3. Official docs on indentation
Got it
name and value are not correct keyword args for disocrd.Embed
!d discord.Embed
class discord.Embed(*, colour=None, color=None, title=None, type='rich', url=None, description=None, timestamp=None)```
Represents a Discord embed...
Well
the code's working now
so let's see
I got another error
this time prefix one
Wanna fix it? stop using replit 
-_-
Try, it works for real 
What should I use then?
using client and commands at the same time
I didn't get u
there is so much wrong there
- u are using client and bot
- u named commands.bot client
- its commands.Bot and not commands.bot
- the kwargs for discord.Embed are wrong as well
🤨
-_-
close your replit tutorial and check that website raven sent
<@&831776746206265384>
ok
something weird is goin on
!silence
✅ silenced current channel for 10 minute(s).
!cban 907364601887354931 attempted raid
:incoming_envelope: :ok_hand: applied ban to @umbral sedge permanently.
!cban 907389469802520678 attempted raid
:incoming_envelope: :ok_hand: applied ban to @fresh wolf permanently.
✅ unsilenced current channel.
awesome
Welcome back, thanks for the patience
uh
did black knight help?
tf raid
brrr
leave that topic and move on
um hi
hola little one
little one?
Prolly ping one of the mods in an ot channel
It was a pretty small raid actually
SPARKY
A slang
Who says so lol
#bot-commands Flooded
Ikrrrr
It involved only a few accounts, right?
😐
seems like that, but lets move on from that topic
!ot
Off-topic channel: #ot2-never-nester’s-nightmare
Please read our off-topic etiquette before participating in conversations.
Suggest more topics here!
idk
The topics are kinda boring 🤷♂️
I think it was 3-4, but lets move on
A feature by which the lib will use GitHub Co Pilot to code the bot itself
💀 github co pilot
whats the point of installing the lib then-
its simply an app that creates bots for you...
The ..
Show yr directory tree
welcome
How can I be a moderator? I want to help the server in these situations
Yea, thanks for scaring me
wdym?
Same
Same
heyo after long in this chat
The different roles in the server are described in #roles
Show yr folder
Can only seem to code a flask api
help pls
cap
I was doing Java
I saw that. But how can they know the 'potential' candidates?
learning?
tools.utils is not a package
Yeah I made a thin wrapper and a game engine
Why do u say so?
For example :- I am a moderator for the past 2 months. I am very experienced with moderation
All helpers+ keep an eye out for users that would be a good fit, and then nominate them to become staff. Not every helper then goes on to become a moderator
How can the staff know how good I am if I can't show them?
show your file structure
What's yr cwd?
What cwd?
they mostly observe you from the shadows
am confused
current working directory
You can participate here on the server, but we aren't really lacking staff members currently
How to learn discord python??
They are always lurking
Also, you don't usually do relative imports outside a package
I see that
import os
print(os.getcwd())
And what about Helpers? Are y'all always looking out for Helpers?
I can't really show my moderation skills without the required perms
like the attempted raid that happened
they just search ur messages
What line? are u looking at the correct doc
or code
Right, moderators are picked from the staff team (helpers) since there is more to the role than just handling raids
Add that in the main file
Isn't a good idea but just block him/her? That's gonna hide their pfp
HELP pls ❤️
bruh
Yes. Helpers are people that help other people with coding. I am not very good at python coding but I can moderate big server very well. So how can I get a chance to be a mod?
Soo to learn discord python i have to learn basic python or intermediate python?
Nope
What add what?
No
For example :- I am helper in AYS (Advertise Your Server - 70k+) members
what?
Well, discord.py is considered a lib for intermediate coders, tho if u are dedicated enough, u can start learning it from the start, along with Python
its like helper > moderator > admin
your file structure mate
I know that
go dms
not yet but there's a pull request :D
wrong one
wait what
any extension does that?
hm?
ayo
new pfp name / nick
import discord
import json
from discord.ext import commands
from Tools.utils import getConfig, updateConfig
------------------------ COGS ------------------------
class ChangePrefixCog(commands.Cog):
def init(self, bot):
self.bot = bot
------------------------------------------------------
@commands.command(name = 'changeprefix',
aliases= ["prefix"],
usage="<newPrefix>",
description="Change the bot's prefix.")
@commands.has_permissions(administrator = True)
@commands.cooldown(1, 3, commands.BucketType.member)
@commands.guild_only()
async def changeprefix(self, ctx, prefix):
data = getConfig(ctx.guild.id)
data["prefix"] = prefix
await ctx.channel.send(self.bot.translate.msg(ctx.guild.id, "changeprefix", "NEW_PREFIX").format(prefix))
updateConfig(ctx.guild.id, data)
------------------------ BOT ------------------------
def setup(bot):
bot.add_cog(ChangePrefixCog(bot))
And username too
do y'all have any idea how to fetch channel names having content based on a keyword
like fetchChannels("meditation"), which should fetch names of channels revolving around meditation
I don't see something like this in the youtube api
I don't really fit the requirements when it comes to helping with coding.
then u cant be a mod or helper
-_-
@velvet compass is this true?
miru has that in the modals branch, probably use it
ah oki, thanks
Its probably a better conversation for #community-meta . But yes, we don't pick moderators outside of the helpers team, as everyone on the server staff is a helper
not sure
not required. brad answerd
uh ok
ok 😭
So ash, Did you fix your command? 
It's my signature
.recources
This... isn't the correct channel?
yeah ik but you guys do a lot thing revolving around youtube
like fetch up youtube video with a command
The Resources page on our website contains a list of hand-selected learning resources that we regularly recommend to both beginners and experts.
No, absolutely
keep the help here btw
Music bot made with youtube apis are against TOS
where is your main file at?
and we can't provide help for them
I using it for my project
@scarlet snowlucas please dms i add you
I'm sorry but keep the help here as I said
I agree, but please open a help channel
exactly 
Lmao
I'll just ask on stackoverflow with my alt 😉
With the API is fine, it's streaming audio from youtube that isnt
you didn't help me
what is your main file at
like the path
send it here
import discord
import os
import json
from discord.ext import commands
from Tools.utils import getGuildPrefix
from Tools.translate import Translate
intents = discord.Intents.default()
intents.members = True
bot = commands.Bot(getGuildPrefix, intents = intents)
HELP
bot.remove_command("help") # To create a personal help command
Translate
bot.translate = Translate()
Load cogs
if name == 'main':
for filename in os.listdir("Cogs"):
if filename.endswith(".py"):
bot.load_extension(f"Cogs.{filename[:-3]}")
@bot.event
async def on_ready():
print(f'We have logged in as {bot.user}')
print(discord.version)
await bot.change_presence(activity=discord.Activity(type=discord.ActivityType.watching, name =f"?help"))
------------------------ RUN ------------------------
with open("config.json", "r") as config:
data = json.load(config)
token = data["token"]
bot.run(token)
is a main.py
😐
!paste please
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.
Bruh the thing is simple
if your file structure is like this:
main.py
package
package_name.py
``` to import package_name.py you would do
```py
from .package import package_name.py
ctx.respond?
Hello 👋 Is there anywhere I can find approximate values for the different rate-limit buckets?
Nope, ratelimits are dynamic and the values arent documented
Specifically to prevent people from using them statically
you can get them in the headers of the responses though, if im not wrong
Do you have a specific bucket in mind you wanna know what it is currently?
if your main file is inside a folder, than you will need . for each folder
folder:
main.py
package:
my_package.py
Import my_package in main.py:
from ..package import my_package
you need to remove self as an arg for that function
self is only used within classes
hi
what is a bucket?
water bucket , that takes 3 iron to make
An identifier of sorts for a specific discord API route
Cringe
minecraft is not cringe
It means you can keep track of how many more requests you can make to that route or routes in the same bucket before being ratelimited
ah ic
no but answering an api question with it is
Absolutely
oh sorry i guess he was playing minecraft
the channel name is not #minecraft sadly, heh
ok
LX be typing .....
Erm, not a specific bucket. You're not aware of anyone who has collected stats and made them available?
200 wps
Not aware of any no, sorry
Yeah just trying to put my thoughts into vaguely coherent words 
I've considered doing it myself a few times but never convinced myself to actually do it
ya that happens a lot, u write delete write again until u reach recursion limit
can i send a msg to all users in a guild with 1 sec timer with each
can i or not
You still can't and it's still API abuse
10 sec timer
Yes
selfbotting not allowed
Only the official client should be connecting on your user account
ya
Mass DMing server members no matter the duration between is API abuse
It's either the same client or it's a terminal, pick one
i mean i will not get ratelimit
A terminal is not the electron client
You won't get ratelimited initially but after your bot will be banned from sending DMs and if it's determined to be malicious - which what you're suggesting is - they'll disable your bot
pls help
Can we see your directory tree?
How do I use a async function within this class? ```py
class Confirm(disnake.ui.View):
def init(self, bot):
self.bot = bot
super().init()
async def function(self, ...): ...``` just like a normal function? do u want to call it or something?
async def self(...,)
@spring flax How can I change the prefix here?
yeah i don't want to make a function i want to use it (call it would be a better word)
you cannot change slash commands prefix, the reason they are called slash commands
How can I use a different prefix then?
change prefix brooooooooo
Not code slash commands
do
make a message command
also slash command dont have prefix noob
noob?
Then why you trolling
what is this 2015?
ye my name
Apparently 
and how do I do that?
whats fortnite
asyncio.run maybe?
check the examples in their github repo
You set a prefix by doing bot = commands.Bot(command_prefix="!")
!e
import asyncio
class Something:
async def foo(self):
return 5
def sync_foo(self):
return asyncio.run(self.foo())
print(Something().sync_foo())
lurking command? is good?
@paper sluice :white_check_mark: Your eval job has completed with return code 0.
5
why
thanks 🙂
a classmethod is a good way its a method that returns an instance of the class which can be async as well
dont go off topic ill call mods
Welcome, make sure to import commands as well by doing from discord.ext import commands
can. you. stop?
hi
ok. so now I use nextcord and discord.ext
nextcord.ext
(shaking gun) i'll - i'll - i' - shoot!!!11! I know how to use dis!11!!1!
!ot
Off-topic channel: #ot2-never-nester’s-nightmare
Please read our off-topic etiquette before participating in conversations.
but how do I use this prefix in the commands?
Oh, then do nextcord.ext instead
dis.dis 
k ig
you call bot in the decorator
class Dog:
@classmethod
async def create_instance(cls) -> "Dog":
return cls()
@spring flax
Like this:
import nextcord as disnake MUHAHAHA
why are u suggesting shit nextcord
How is that?
language
Excuse me?
I'm sorry I might be irritating you but I'm new to coding a bot. @frozen patio
Excused
okay I will give that a try thank you
How about we don't just go around insulting libs
nextcord isnt bad have you ever even seen its source code?
sorry, what's the context of the question?
@bot.command()
async def hello(ctx):
await ctx.send("Hello there!")
yes
youre welcome!
nextcord is best
@forest bramble Like this
wrong reply lmao
i send everyone friend request pls accept
Yeah I saw that
I want a custom prefix for this code instead of the slash prefix
I am not gonna accept it
ok
why bro
🍿
wait so what about the def __init__ of the class?
you can change the prefix, just change the ! in the command_prefix line to whatever
we will make projects together
No.
😦 bro
Don't roast nextcord then
ok
u can do that as well
import nextcord
from nextcord.ext import commands
bot = commands.Bot(...)
@bot.command()
async def hello(ctx: commands.Context):
await ctx.send("hey")
bot.run("token")```
nextcord is worst i hate it
bot = commands.Bot(command_prefix="!")
!d discord.ext.commands.Bot
class discord.ext.commands.Bot(command_prefix, *, help_command=<default-help-command>, tree_cls=<class 'discord.app_commands.tree.CommandTree'>, description=None, intents, **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...
can you not?
This dude over here
all of the params are here
❤️
so what is the prefix here?
if you need arguments yeah just add it and you would pass it like so
class Dog:
def __init__(self name: str) -> None:
self.name = name
@classmethod
async def create_instance(cls, name: str) -> "Dog":
return cls(name)
Dog
yup
i love dogs
same
i love cats
cat person here
!ot
Off-topic channel: #ot2-never-nester’s-nightmare
Please read our off-topic etiquette before participating in conversations.
If you're not asking for help or giving help can you kindly just go away
bot = commands.Bot(command_prefix="whatever you want it to be")```
#discord-bots message
idk why you would ever want that, but there u go
i asked but none answered me
so im sad
Ikr
what's your question?
ok
Not a reason to start baselessly insulting nextcord
you can have return annotations of a string?
Yup
So how do I use it in this code? @slate swan
yeah
how can i use multiple bot in 1 bot
like 3 bots working samehow can i use multiple bot in 1 bot
like 3 bots working same
I learned Python by coding in that lib 
help
VSC isn't very happy with that for some reason
lag
I gave you an example...above
when u do from __future__ import annotations it converts all annotations to strings, this will be a feature in 3.11 (like u dont need future) for that
bro im sorry but can u tell me i also want that theme
you can also use typing.Self is the lib or typing_extensions i forgot
I'm asking in the code in the image I sent above
YOU CANNOT CHANGE PREFIXES IN SLASH COMMANDS, YOU HAVE TO CREATE MESSAGE COMMANDS FOR CUSTOM PREFIXES, SEE THE EXAMPLE ABOVE
ah shit too many caps

Oh ash is upset
I mean we explained it like 10 times
been saying the same thing from the past 10 mins
I'm sorry if I am irritating you. I'm just new to creating custom bots.
I'm learning
Here is a SIMPLE custom prefix script
I just......I just....gave you an example above....
welcome to my world 
last question if I want to call this function within that class I need to use the asyncio.run right?
yes
how can i use multiple bot in 1 bot
like 3 bots working same
why would u want that? No u can't do that either
i want 3 bots for 3 different server
Ash learned not to answer some question, now it's your turn

ok
im a freelancer
ok
import nextcord
from nextcord.ext import commands
bot = commands.Bot(command_prefix="!")
@bot.command()
async def hello(ctx):
await ctx.send("Hello there!")
bot.run('TOKEN_HERE')
and im making
idc man, i answer like 1 or 2 questions a day
@forest bramble this is good
ok
invalid token
Nooooooooooooooooo
yes
I thought that was the token for all bots
you can run multiple bots within one file
so the blue-colored hello in the command right?
I know it's invalid
Runtime error:
im calling the mods next, stop shitposting
That's the ccommand name yes
no☹️ 🥺
how would I loop through a list and for each element add a ui,button? I would have to do bot.add_view?
Then help out or ask for help
finnaly i learnt it