#discord-bots
1 messages · Page 541 of 1
@client.command(description="Muta un utente")
@commands.has_guild_permissions(manage_messages=True)
async def mute(ctx, member: discord.Member, *, reason=None):
guild = ctx.guild
mutedRole = discord.utils.get(guild.roles, name="Mutato")
if not mutedRole:
mutedRole = await guild.create_role(name="Mutato")
for channel in guild.channels:
await channel.set_permissions(mutedRole, speak=False, send_messages=False, read_messages_history=True, read_messages=False)
await member.add_roles(mutedRole, reason=reason)
await ctx.send(f"Ho mutato {member.mention} | Motivo: {reason} ")
await member.send(f"Sei stato mutato in {guild.name} | Motivo: {reason} ")```
this is the code
nothing looks wrong
ik
exactly
except that you named your bot var client instead of bot 🤨
naming conventions, won't actually affect your code but it'll look nicer
it's depending on what a person finds nice
anyways, after you added some print statements lmk where it's not printing but you know that it should
for me client is better :p
but the code is all right
mh
what version of dpy are you on

idk
could also be that the dpy version that you're using is extremely outdated
2.0.0a3
weird
ah?
hmm 
wait i just noticed, are you using this in another file
no
alr 
i don't actually know tbh, never had this problem
and the code looks alright too
are you sure that you're passing the right token? and that you're running the bot?
or do you by any chance have anything that's blocking in your code
yes
then idk ¯_(ツ)_/¯
no, problem thanks
if someone have an answer, pls answer it lol
this is what i found, but it seems not working too :/
Heroku seems to work with aiosqlite, interesting
myString = 123
myInt = "Hello World!"
pretty nice, innit
that’s not remotely close to naming a Bot instance client
since Bot subclasses Client we can say it’s okay to name it client
but str doesn’t subclass int so that doesn’t make sense
👍
Do you mean independently?
Oh
I have not tested it yet
It probably will be
I will anyways be rewriting the whole database to mongodb
or postgres, not 100% sure yet
I meant heroku offers a persistent database, so I was wondering if you are saying it's something other than that.
Is there a way I can store all my commands in one file and then require them in the main file?
cogs?
bot.commands is a list of all commands excluding subcommands
yes
oh found it
await client.change_presence(status=discord.Status.offline)
it seems not working
iirc heroku offered 1GB free of postgre
good to know
i could be wrong tho
no it's not space limit, it's rows limit
you can have a max of 10k rows
and here's the docs https://devcenter.heroku.com/articles/heroku-postgresql#connecting-in-python
Hello, i want some help, when i try to connect the mongo db i have a certificate error
Someone can help me please
If I was to store a users xp would i use mongodb?
questions regarding databases in #databases
you're more likely to get help there
yeah you can use mongodb for that too
K thx
Hello i have a cmd sp!setup that sends a message and waits for 30s but if the author again replies sp!setup, the message get taken but the same cmd runs again. How to prevent it?
change it in the bot constructor
Don't change_presence (or make API calls) in on_ready within your Bot or Client.
Discord has a high chance to completely disconnect you during the READY or GUILD_CREATE events (1006 close code) and there is nothing you can do to prevent it.
Instead set the activity and status kwargs in the constructor of these Classes.
bot = commands.Bot(command_prefix="!", activity=..., status=...)
As noted in the docs, on_ready is also triggered multiple times, not just once.
Basically: don't 👏 do 👏 shit 👏 in 👏 on_ready.
I create database at on_ready
nice
if we want the guild + amount of users in the status/activity before bot was defined how would we do that?
use a startup task
haven't thought about that
How do I get a list of the names of the servers the bots are join?
!d discord.Client.guilds iterate thru it and use .name
property guilds: List[discord.guild.Guild]```
The guilds that the connected client is a member of.
client.guilds
i subclass Bot and assign a db attribute
Never understood that method so I always create connection on every command
Can anyone tell me, is there a way to pass parameters such that
....
if a user enters a sentence and then type -b and and then another sentence so I want my bot to put sentence 1 in variable 'a' and sentence 2 (after -b) in variable 'b'
At last I have my shard ratelimiter not spamming the gateway with identifies 
hm
using str.split('-b')
!d str.split
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:
I make a loop task which refesh the activity variable every 10 minutes and then I put taskname.start() in on_ready field
Is it possible to generate an invitation link from a server id?
if your bot is in that server, yes
u need channel id
as well as having permissions to create an invite
why in on_ready? .start() isn't a coro so you don't have to do it inside a asynchronous function
imagine if there are different splits like that...
for example, first two sentences get spilit by -b and then to split in the third, we need -c
like xsplit I am blank -b I am a male -c I went to a party
The bot is in the server and has admin rights, but there is no channel ID....
loop over the channels, get the first channel, create invite
um........ ok....
if you expect them to be in that order, then get the last element in the list which is returned from .split and split it again
o ok
idk its working for me so I used it
e.x: ```py
string = "I am blank -b I am a male -c I went to a party"
split = string.split('-b')
split_c = split[-1].split('-c')
teach me js oop!
Could you tell me how? (Preferably with code.
what do you not know exactly
!d discord.Guild.text_channels
property text_channels: List[discord.channel.TextChannel]```
A list of text channels that belongs to this guild.
This is sorted by the position and are in UI order from top to bottom.
this returns a list of the guild's channels
a for loop maybe
you don't even have to do a for loop actually
Sorry for the dumb question, I dont know much about lists, why is there split[-1] in the sentence
you can just index the 1st
because .split returns a list
indexing with -1 returns the last element
o yeah yeah
Returns a list of the words in the string,
@slate swan
but if you wanna get that kind of info from a user i recommend using wait_for
hm
i knew that but I didnt understood what [-1] meant
bruh i am bad at oop
y- your about me tho
i do know js but am bad at oop
hm nice
objects are not that hard right? right??
Lmfao
huh, tell me about it. i still couldn't figure out pythons disctionaries
bruh
!e
dict = {"name":"panda", "age":18, "gender":"male"}
print(dict)
@boreal ravine :white_check_mark: Your eval job has completed with return code 0.
{'name': 'panda', 'age': 16, 'gender': 'male'}
idk whats hard 
I'm 18 😥
hm
i do know how to do dat but am not good at working with dicts
cool
argparse exists...
never used it
i can't really recommend something that i never used myself when there's something that i know how to use in that area
hi
well... it really depends on your dedication
if you go with the mindset that you only need a discord bot and that you don't wanna learn the language, then you'll struggle with absolutely everything and never learn anything
which is literally what 80% of the discord bot devs do
helppppppp
ctx.guild.owner
tnx
Hi everyone , Any idea on how to hide or disable a specific slash command and keep it enabled only for owner/admins
depends on what your using fot slash commands
How to achieve such thing
@slate swan u can see some are disabled for regular members
As he said, it depends on what lib/fork you're using for slash commands
Every lib/fork does it differently
Here is my imports , discord py
import discord
from discord_slash import SlashCommand
Ah, never used discord_slash, so idk how or if they even support perms for slashes
You could ask in their support server, you'd have more chances of getting help there
im gonna check discord_slash github and source code for abit
wait how do i make my bot delete his own message?
msg = await ctx.send()
await msg.delete()
can u send an invite
bruh
appreciated
Check the GitHub or the PyPi page
ty
Check the pypi page
(:
How can I make a role?
hmm can you send the github or the pypi i cant find it
!d discord.Guild.create_role
await create_role(*, name=..., permissions=..., color=..., colour=..., hoist=..., mentionable=..., reason=None)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).
Creates a [`Role`](https://discordpy.readthedocs.io/en/master/api.html#discord.Role "discord.Role") for the guild.
All fields are optional.
You must have the [`manage_roles`](https://discordpy.readthedocs.io/en/master/api.html#discord.Permissions.manage_roles "discord.Permissions.manage_roles") permission to do this.
Changed in version 1.6: Can now pass `int` to `colour` keyword-only parameter.
(:
FAST AWNSER
Eh, I was here only, sooo 🤷♂️
LOL
neiher do I 😦
Like this?
await create_role(name="Muted", permissions=send_messages=False, color="e90000", reason="Hunter did it. not me!")
Nope, remove the *
Than is it all?
Eh, u r doing the perms wrong. Also, remove the reason kwarg if u want it to be None
Permissions accept a dict of perms iirc
Lemme give u an example. Gimme 1
I asked there but they said :
That's a third party library, and we do not help with it
https://discordpy.readthedocs.io/en/master/api.html#discord.Permissions
These are the perms. It should be something like
{
"send messages": True,
"embed links": True
}
Try doing this
await create_role(name="Muted", permissions={
"send messages": True,
"embed links": True
}, color="e90000", reason="Hunter did it. not me!")
this???
😐 😦
permissions=discord.Permissions(send_messages=True, embed_links=True)
Should be like that
how do i make that it shows specific item icon and not flood the chat
putting icon id into inventory 💀
i said discord_slash support server
@commands.Cog.listener()
async def on_message(self, message):
print("executed?")
await message.channel.send("am i looping?")
when i send i message like this it just repeatedly executes the on_message command so i get a infinite loop of the "executed?" text. However if i remove the "await message.channel.send" it only sends it one. does anyone know how to get it to stop looping?
check the message content
what do you mean?
do you want the event to stop looping?
yeah
can u invite or send me link please
how do i fix this that it wont flood the embed and it show the specific item icon
@bot.command(aliases = ['inv'])
async def inventory(ctx, member : discord.Member=None):
print(f"{ctx.author} issued inventory command")
if not member:
await open_account(ctx.author)
user = ctx.author
users = await get_bank_data()
try:
inventory = users[str(user.id)]["inventory"]
except:
inventory = []
em = discord.Embed(title = "Inventory")
for item in inventory:
for icon in mainshop:
name = item["item"]
amount = item["amount"]
icon = icon["icon"]
em.add_field(name = f"{icon} {name}", value = amount, inline=False)
await ctx.reply(embed = em)```
As i said, check discord_slash pypi, I'm not in their sever
Never used discord_slash
then do ```py
if message.content == "something":
#code
Been using Heroku hosting service for a while - it's good but it cycles randomly causing the bot to restart and forget locally stored text files and so on. Is there a service which does not cycle and wont restart my bot for any reason?
but i want it to execute no matter the content
A vps
and there no other way to handle bot slash commands except through this library ?
hm
And it's by far the best fork out of any other
maybe because your using a for loop
but i need the specific item icon
oh its looping because it detects it's own event so executes the on_message again to respond to the message it just sent. hence an infinite loop ...
limitmsg = "The limited commands in this server are:\n"
limitmsglist = []
for command in guildLimit.keys():
cmd = self.bot.get_command(command)
cogname = cmd.cog.qualified_name
channelList = guildLimit[command]
if len(channelList) == 0:
continue
else:
limit_msg = f"**Command:** `{command}`, **CogName:** `{cogname}`\n"
for channelid in channelList:
channel = self.bot.get_channel(channelid)
limit_msg += f" **Channel:** {channel.mention} | **Channel ID:** `{channel.id}`\n"
if len(limitmsg) + len(limit_msg) < 2000:
limitmsg += limit_msg
else:
limitmsglist.append(limitmsg)
limitmsg = limit_msg
for limitmsg in limitmsglist:
await ctx.send(limitmsg)```
for some reason it is not sending the full list
check if the message author is a bot?
hey I need help
whenever I delete a channel it says 'NoneType' object has no attribute 'delete'
any help please
we don’t have telepathic powers
who knows
think about it with your brain
create_role is not defined and that’s not how you add permissions
!d discord.Guild.create_role
await create_role(*, name=..., permissions=..., color=..., colour=..., hoist=..., mentionable=..., reason=None)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).
Creates a [`Role`](https://discordpy.readthedocs.io/en/master/api.html#discord.Role "discord.Role") for the guild.
All fields are optional.
You must have the [`manage_roles`](https://discordpy.readthedocs.io/en/master/api.html#discord.Permissions.manage_roles "discord.Permissions.manage_roles") permission to do this.
Changed in version 1.6: Can now pass `int` to `colour` keyword-only parameter.
than
read
doesn’t seem like it
finally switched to vscode I see
it clearly says permissions takes a Permissions object
and you’re passing in a dict
so i dont know
lmao no
replit
oh that's replit? :P
vscode when
alr found the solution
can someone help me with this kind of error?
show code
missing colon
and you need to subclass commands.Cog not commands.cog
Missing colon, .Cog not .cog
and follow naming conventions
^
How can I store all my commands in one file and then require them in the main file?
Can you guys give me an ex code to made a role with bot?
how to make a check that if its not admin then he cannot use the command?
not the server
How can I make it if a message is over the discord limit, make the bot say “…” or “message is too long”
so like
you get the message author
and you see if the user has the
role
nono
any way by which i can make MY CODE add NEW commands to itself?
like
admin = 'my friends id', 'my id', 'my another friends id'
and if its not admin then the command returns false
you make a check
@bot.check
async def admincheck(ctx):
if ctx.author.id not in adminlist:
return False
return True```
ignore mobile indenting
!d discord.ext.commands.Bot.add_command
add_command(command)```
Adds a [`Command`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.Command "discord.ext.commands.Command") into the internal list of commands.
This is usually not called, instead the [`command()`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.GroupMixin.command "discord.ext.commands.GroupMixin.command") or [`group()`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.GroupMixin.group "discord.ext.commands.GroupMixin.group") shortcut decorators are used instead.
Changed in version 1.4: Raise [`CommandRegistrationError`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.CommandRegistrationError "discord.ext.commands.CommandRegistrationError") instead of generic [`ClientException`](https://discordpy.readthedocs.io/en/master/api.html#discord.ClientException "discord.ClientException")
I think theres a better way to do it but I can’t remember how
ik that i can use database
but it's too much work
how do i use it?
no, you can make a command that autoadds commands but I can’t recall how to do it
i've followed the naming convention and still got the error
you need to do class Music(commands.Cog):
can someone help me pls
I recommend learning syntax
say your question
im trying to make it so noone but a admin/owner can use ban and kick command but idk how
my friend was helping me but he had to go to sleep
!d discord.ext.commands.has_permissions
@discord.ext.commands.has_permissions(**perms)```
A [`check()`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.check "discord.ext.commands.check") that is added that checks if the member has all of the permissions necessary.
Note that this check operates on the current channel permissions, not the guild wide permissions.
The permissions passed in must be exactly like the properties shown under [`discord.Permissions`](https://discordpy.readthedocs.io/en/master/api.html#discord.Permissions "discord.Permissions").
This check raises a special exception, [`MissingPermissions`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.MissingPermissions "discord.ext.commands.MissingPermissions") that is inherited from [`CheckFailure`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.CheckFailure "discord.ext.commands.CheckFailure").
@bot.command()
@commands.has_permissions(administrator=True)
async def kick(): …```
use this check , with administrator=True
thiis command only runs if the author has administrator
*commands
tysm
this is the case of class
In which, we already have made some COMMANDS inside the class,
and we want that commands to be added inside the COGS of the bot
theres an error now
?
can u help me theres a collabe link
just say the error
File "main.py", line 37
async def ban(): …:
^
SyntaxError: invalid character in identifier
here
How would I code a bot where every time someone joins it dms them
on_member_join
How would it dm em
await member.send
@manic wing its fix now thanks
There's also a lot of vids just look it up @slate swan
Send ur code
Yes
dms?
Send it here
what code
The code block that's raising the error
File "main.py", line 37
async def ban(): …
^
SyntaxError: invalid character in identifier
Send the whole code
i can send u collab link in dms
bryh wgat
Just send a ss lol
i sent you colab link already EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE
what is ss btw
idfk how to use @bot.check so i did this
adminlist = ["460479556156129291", "629606911062573059"]
if not user:
if ctx.author.id not in adminlist:
await ctx.reply("You are not admin.")
return False
else:
#hypeblox : 460479556156129291
#gnbimgoid : 629606911062573059
await open_account(ctx.author)
users = await get_bank_data()
users[str(ctx.author.id)]["wallet"] = amount
with open("mainbank.json","w") as f:
json.dump(users,f)
await ctx.reply("Command executed successfully")
return True```
Yes bro
shut up
where is this
just use my exact code
@bot.check just runs before every command is activated
@covert igloo
and how do i use it
with my command
i need examples with my code
E
what do i dooo
mate; bot.check just runs before every command gets executed. If you put return True, the command runs. If you put return False, it doesnt. Easy as.
I gsve an example
so i can add my code into check?
what x.z
Read the error, and then you'll know where's your issue.
bruh
what i have to do with that check
add it and whats next
how do i get member count of my server with bot?
!d discord.Guild.member_count
property member_count: int```
Returns the true member count regardless of it being loaded fully or not.
Warning
Due to a Discord limitation, in order for this attribute to remain up-to-date and accurate, it requires [`Intents.members`](https://discordpy.readthedocs.io/en/master/api.html#discord.Intents.members "discord.Intents.members") to be specified.
Guild.members
len(guild.members)
Just guild.member_count.
where guild is an instance of discord.Guild
both work
i am getting this
UnboundLocalError: local variable 'message' referenced before assignment
the code is on_message
i add piece of code into check?
show the code.
@bot.listen('on_message')
async def on_message(msg):
elif msg.content.lower().startswith('op'):
sending=await msg.channel.send(f'{msg.guild.name} server is OP!')
await sending.add_reaction('☑️')
elif msg.content.lower().startswith('prefix'):
await msg.channel.send('The prefix of the bot is ***`.`***')
elif msg.content.lower() == 'ping':
before = time.monotonic()
message = await msg.channel.send("Pong!")
ping = (time.monotonic() - before) * 1000
await message.edit(content=f"The ping is- `{int(ping)}ms`")
elif msg.content.lower().startswith('date'):
today=today = date.today()
await msg.channel.send("Today's Date is-"+'***'+today.strftime("%B %d, %Y")+'***')
elif msg.content.lower().startswith('member'):
await message.channel.send(len(guild.members))```
the last part
hello can i have help
One is slower than the other.
Don't ask to ask just ask
What is guild?
You haven't defined it.
how to do that?
there are many things you can do if you want to limit commands to only a certain group of people:
a) you can just put if ctx.author.id not in adminlist: return at the start of the command you don't want normal people to run. This works, but may be annoying for you to change later.
b) put hidden=True when you do the @bot.command() and then add a check like this:
@bot.check
async def botcheck(ctx):
if ctx.author.id not in adminlist and ctx.command.hidden: return False # the command.hidden can act as an 'admin-only' command
return True #this means its a normal command```
Ah. So you just started learning Python, or in other words, just started copying code.
@slate swan
will it work?
guild = bot.get_guild(ID)
!resources Please, learn Python before jumping into discord.py.
The Resources page on our website contains a list of hand-selected learning resources that we regularly recommend to both beginners and experts.
!d discord.Message.guild
The guild that the message belongs to, if applicable.
Good.
Just realized what you're doing. You shouldn't make commands like that. Use command decorators
That's understandable.
And this. 
ik, i am just making my life easier
my bot has list of custom replies inside the cogs file
That's making it harder, tbh.
no lol
and, i dont want to add stuff to cogs
when you learn what you're doing wrong you will have to rewrite ALL your code
No it's making it a lot harder
maybe shortterm its easier, but you're going to have to rewrite everything when you learn why commands and cogs are better
everyone folds at some point
You cant have elif without an if
i want my bot to be able to reply to message
any way - by not using 'on_message'
Noone likes a 2k long main.py -_-
w h a t
i did
Also you're triggering these without a prefix
Mayhaps it would be good to show them how cogs can be better :P
There's a bunch of stuff about cogs at https://vcokltfre.dev/tips/cogs so you can see why they make life easier
full code is-
@bot.listen('on_message')
async def on_message(msg):
if msg.author == bot.user:
return
elif msg.content.lower().startswith('mochi'):
lst=[':m:',':regional_indicator_o:',':regional_indicator_n:',':regional_indicator_k:',':heart:']
await msg.channel.send("Monk's Bae")
for x in lst:
await msg.add_reaction(x)
elif msg.content.lower().startswith('monk'):
lst=[':m:',':regional_indicator_o:',':regional_indicator_c:',':regional_indicator_h:',':information_source:',':heart:']
await msg.channel.send("Mochi's bae")
for x in lst:
await msg.add_reaction(x)
elif msg.content.lower().startswith('op'):
sending=await msg.channel.send(f'{msg.guild.name} server is OP!')
await sending.add_reaction(':ballot_box_with_check:')
elif msg.content.lower().startswith('prefix'):
await msg.channel.send('The prefix of the bot is ***`.`***')
elif msg.content.lower() == 'ping':
before = time.monotonic()
message = await msg.channel.send("Pong!")
ping = (time.monotonic() - before) * 1000
await message.edit(content=f"The ping is- `{int(ping)}ms`")
elif msg.content.lower().startswith('date'):
today=today = date.today()
await msg.channel.send("Today's Date is-"+'***'+today.strftime("%B %d, %Y")+'***')
elif msg.content.lower().startswith('member'):
await message.channel.send(len(guild.members))```
i dont understand pyhton
i already use cogs for other REPLIEs
you use elifs for different outcomes of the same check sorta
!resources you are able to check some of these resources to get familiar with Python.
The Resources page on our website contains a list of hand-selected learning resources that we regularly recommend to both beginners and experts.
it should be ```py
if msg.author == bot.user:
return
if msg.content.lower().startswith('mochi'):
lst=[':m:',':regional_indicator_o:',':regional_indicator_n:',':regional_indicator_k:',':heart:']
await msg.channel.send("Monk's Bae")
for x in lst:
await msg.add_reaction(x)
elif msg.content.lower().startswith('monk'):
because msg.author is different to msg.content
the function will return if the message is by BOT itself right?
if you return to the function call after that if check returns True, then it should stop executing if the bot calls on_message
yes, ik it works
the problem is
i want my bot to replymembercount whenever someone types member
simple, however i dont recommend making commands using on_message
^
ik, but there is no way my bot would be knowing if someone types only member
cause it would need prefix first
Why would you want the command to trigger without a prefix though
Let's say some people were complaining about their ping in a game
it's faster for NEw guys
who does not even know how to use BOT commands
Your bot would just constantly be sending the ping of itself
ideally you should just use slash commands instead which discord prompt new users on, as they're designed to be more intuitive
if message.content.startswith("member").lower():
await message.channel.send(len(int(message.guild.members)))```. i’m on my phone so forgive me if i messed up any syntax
I think most people don't like making slash commands
i mean, "sucks" tbh, discord's making people use slash commands so slash commands people should use
idm, cause it is not used often
and the server its in does not have active chat
yeah; i feel as if i’m too lazy to learn the dislash library though ngl.
I personally just don't like the concept of slash commands
disnake's impl. of slash commands is pretty nice
tries this
elif msg.content.lower().startswith('member'):
await msg.channel.send(len(msg.guild.members))```
gives `1`
intents
!intents
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.
Whether guild member related events are enabled.
This corresponds to the following events...
you need this specifically
gtg i'll try later ty guys
you’re welcome
Will anyone help me?
How?
i was considering making some bash aliases to request and quickly respond to any notifications i may have in discord, do you guys know if something like that is against ToS? It's automation of a normal user i guess? but im not going to distribute it in any way.
i should say python scripts not aliases
limitmsg = "The limited commands in this server are:\n"
limitmsglist = []
for command in guildLimit.keys():
cmd = self.bot.get_command(command)
cogname = cmd.cog.qualified_name
channelList = guildLimit[command]
if len(channelList) == 0:
continue
else:
limit_msg = f"**Command:** `{command}`, **CogName:** `{cogname}`\n"
for channelid in channelList:
channel = self.bot.get_channel(channelid)
limit_msg += f" **Channel:** {channel.mention} | **Channel ID:** `{channel.id}`\n"
if len(limitmsg) + len(limit_msg) < 2000:
limitmsg += limit_msg
else:
limitmsglist.append(limitmsg)
limitmsg = limit_msg
for limitmsg in limitmsglist:
await ctx.send(limitmsg)```
for some reason it is not sending the full list
is it related to discord bots tho 
yes
@crystal cliff
the alternative would be for me to create a bot account and get it invited to servers im in, and then automate that
and in both cases id be using the discord API
automating user accounts is against ToS
ah
does anyone know zeobot?
is there such thing as a graphical bot client? like using a bot as if it were a normal user but you have your own client
No
This would require modifying the client, which is against the ToS
At least if you were to login the bots account via its token
To the discord client, otherwise I'm sure some programs out there exist for this purpose, but logging in as a bot is a grey area in the ToS I'd say
When i try to use the command !dm i get this error: AttributeError: 'DMChannel' object has no attribute 'name'
Here is my code:
filenameArray = []
@client.event
async def on_message(message):
if(message.channel.name == 'visitcard_database'):
filename = message.attachments[0].filename
filename.replace(".png","")
filenameArray.append(filename)
await client.process_commands(message)
@client.command()
async def dm(ctx):
await ctx.author.send(filenameArray)
dm channel doesn't have a name because it's in a dm
you should add a check to filter out dm messages
What check do you have any examples?
if type(message.channel) != discord.DMChannel:
# do code
```This is just a sample. You can expand this depending on your requirements
Still don't understand it. When i remove the event function the dm command is working fine. The error refers to the if function from the event command
line 15, in on_message
if(message.channel.name == 'visitcard_database'):
AttributeError: 'DMChannel' object has no attribute 'name'
it's because of the dm thing. Dm channels doesn't have a name
@lusty swallow got it working
filenameArray = []
@client.event
async def on_message(message):
if type(message.channel) != discord.DMChannel:
if(message.channel.name == 'visitcard_database'):
filename = message.attachments[0].filename
filename.replace(".png","")
filenameArray.append(filename)
await client.process_commands(message)
@client.command()
async def dm(ctx):
await ctx.author.send(filenameArray)
```This should work tho
I understand it, but i already got if(message.channel.name == 'visitcard_database'). I'm using the dm command not in this channel
Why check the type if you can just do if not message.guild?
sorry, that would be a better solution. I just suggested a solution i know would work since i can't test it right now
Thanks for the support guys appreciate it 😊
what
true.lower()
or false.lower()
tf is that?
@lunar helm max characters maybe
what is the max
max is 1024 iirc
ok let me try

.bm a embed thing
Hello, I am making discord bot over python, and i am trying to make autorole, but it's not working. This is my code:```Intents = discord.Intents(messages=True, guilds=True, reactions=True, members=True)
bot = commands.Bot(command_prefix = '-')
@bot.event
async def on_member_join(ctx):
autorole = discord.utils.get(ctx.guild.roles, name = 'Member')
await ctx.add_roles(autorole)``` Can somebody help me please? I've tried everything and it still doesn't work
So | bot = commands.Bot(command_prefix = '-', intents=intents)?
bot = commands.Bot(command_prefix = '-', intents=intents)```
I'm not sure about this way of defining the intents
you wrote it with a capital letter
It propably has to be Intents = Intents.. :D
intents=Intents
I am finding why is it not working for 2 hours, and you wrote ONE thing, and its works
Actually god
Thank you so much bro!!!!!
Yes, i will. Again, thank you so much!!
feels really bad
you're welcome
what's the error
wait why are you deleting every role from a guild
what's that for
well we can't really help with such troll bots I think
Sad, nuke bots
idk why ppl think nuking a guild is fun
🤷♂️
how to make bot restart
await ctx.reply("Restarting... :arrows_counterclockwise:")
await ctx.bot.logout()
print("Logged out")
await ctx.bot.login("joe mama", bot=True)
await ctx.reply("Done! :white_check_mark:")
print("Logged in")```
!d discord.ext.commands.Bot.login
await login(token)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).
Logs in the client with the specified credentials.
idk about that joe mama there
token as str
the bots token from the dev portal
the first one
and the bot died
show code
admins = 772460927685230592, 460479556156129291, 629606911062573059
if ctx.message.author.id in admins:
await ctx.reply("Restarting... :arrows_counterclockwise:")
await bot.close()
print("Logged out")
await bot.login("joe biden")
await ctx.reply("Done! :white_check_mark:")
print("Logged in")```
bruh
ikr
did you replace the bot token with joe biden?
ye
ohk
Does login connect to the websocket though?
Yup iirc
!d discord.Client.start
await start(token, *, reconnect=True)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).
A shorthand coroutine for [`login()`](https://discordpy.readthedocs.io/en/master/api.html#discord.Client.login "discord.Client.login") + [`connect()`](https://discordpy.readthedocs.io/en/master/api.html#discord.Client.connect "discord.Client.connect").
wait seems like no
bruh
connect does
u also gotta call connect
try bot.start()
pass in the token
helppppppppp
yw
specify the reason?
yep i want to make bot
elaborate
ik how to make it in js but i just copy paste code i want to learn it in python
The guild’s ID.
hiiiiiiiii
hi
whats the problem?
users = await get_bank_data()
try:
inventory = users[str(user.id)].get("inventory")
except:
inventory = []
obj = {"item": item , "amount" : amount}
users[str(user.id)]["inventory"].remove(obj)```
i want to make bot in py
help??```py
Exception in voice thread Thread-8
Traceback (most recent call last):
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/player.py", line 673, in run
self._do_run()
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/player.py", line 666, in _do_run
play_audio(data, encode=not self.source.is_opus())
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/voice_client.py", line 672, in send_audio_packet
self.socket.sendto(packet, (self.endpoint_ip, self.voice_port))
TypeError: str, bytes or bytearray expected, not _MissingSentinel
172.18.0.1 - - [17/Oct/2021 16:53:14] "HEAD / HTTP/1.1" 200 -
Exception in voice thread Thread-12
Traceback (most recent call last):
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/player.py", line 673, in run
self._do_run()
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/player.py", line 666, in _do_run
play_audio(data, encode=not self.source.is_opus())
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/voice_client.py", line 672, in send_audio_packet
self.socket.sendto(packet, (self.endpoint_ip, self.voice_port))
TypeError: str, bytes or bytearray expected, not _MissingSentinel
your code doesn't match your error
holy
heres full code
@bot.command(aliases=['dii','delinvitem','delitem'])
async def removeinvitem(ctx, user : discord.Member, amount:int, *, item,):
admins = 772460927685230592, 460479556156129291, 629606911062573059
if ctx.message.author.id in admins:
users = await get_bank_data()
try:
inventory = users[str(user.id)].get("inventory")
except:
inventory = []
obj = {"item": item , "amount" : amount}
users[str(user.id)]["inventory"].remove(obj)
else:
await ctx.reply("You are not allowed to execute this command. :thumbsdown:")```
help me to learn
pov : u dont know what google means
A tutorial on how to use discord.py to create your own Discord bot in Python, written to fix the flaws of many other popular tutorials.
^
!ytdl
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)
yes
your error isn't related to that command
WDYM
there's no x var in your code
so?
ik how it come online but i cant sent msg error is coming
alr nvm i just tested it out, you're getting an error because there's no obj in your inventory
do you have the guild object?
just get it
click on the guild icon in discord with right click
click copy ID
on discord
just the picture of the server

copy ID in English
also, you have to enable developer mode
no tag for it sadly @amber imp
Ok
help me for making bot my bot come online now msg sent
Okay
But what to help?
can you help me
what have I just told u
Yes but in what
...
you're just telling us "help me man"
we need code and error
atleast
Yes
@graceful gorge ?
i will show you
Okay
meh dpy coder — today at 19:03
can we talk in dm
Why?
so i will share screen
Ohh but i m on mobile now
Send your code, your error and what its meant to do
dont @amber imp u will be trapped in a helping hell loop
just ask here everybody
Send your code, your error and what its meant to do here
Endless loop?👽
File "c:\Users\Admin\Desktop\python\real wale\my bot.py", line 9
general_channel = client.get_channel(877778689650200579)
^
IndentationError: expected an indented block
oh gosh
!indents @graceful gorge
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
i need to work out how to use a paid proxy with requests module
import requests
from bs4 import BeautifulSoup as bs
string=input("Enter anime name: ")
url=f"https://myanimelist.net/anime.php?q={string.replace(' ', '%20')}&cat=anime"
r=requests.get(url)
soup=bs(r.content, 'html5lib')
temp=soup.find_all('div', attrs={'class':'box-unit1'})
print(temp)```
It returns empty list, I want to get the url of the first anime in search list (Also I dont want to use the API of myanimelist)
please help
That doesnt sound discord bot related, #❓|how-to-get-help maybe?
It's a easy error just indent it
that doesn't have to do anything with dpy @slate swan
!resources pls @graceful gorge
The Resources page on our website contains a list of hand-selected learning resources that we regularly recommend to both beginners and experts.
how
That doesnt sound discord bot related, #❓|how-to-get-help maybe?
that's not dpy either
Just indent line 9
how to do it
!resources
The Resources page on our website contains a list of hand-selected learning resources that we regularly recommend to both beginners and experts.
U don't know indentation
I suggest reading this
U need to learn python first bro
nope i am a beginner
ik py
just i am starting
Discord.py is a advance python library i think , right?
yes
yes
For that u need to learn basic python programming buddy
its totally a beginner module
ik basic
No it's not
ik print command
nop
@graceful gorge
Before learning discord.py, you should know all of these in Python first!
variables
scoping
functions
asynchronous programming
classes/oop in general
decorators
subclassing/inheritance
type-hinting
imports
Indentation is the basics of python. Anyway
print('hello word')
!resources
The Resources page on our website contains a list of hand-selected learning resources that we regularly recommend to both beginners and experts.
@graceful gorge thats a function
Seriously?
ik all of all
i know
are you trolling rn?
Indentation too
i am totally beginner but i made a bot that does auto mated commands in vm to stream movies from popcorn time on my server
Who?
nice
$sudo hack @amber imp 54336546 it my command to copy paste
@amber imp
lol
ik import
sarcasasm
Bro
Making bots is easy anyone can make but if you want to learn python it's not the right way
import discord
uhhhhhhhhh you can learn python BY CODING IT
A kid can make bot if he wants
actually it was school prject forget it
simp
can you help me for making bto
By coding but u need to learn what to code
bro pls help me
or use scratch
yaar
i use it but i am unable to start it
ik basic programming right now am learning threading and stuff
why not?
Import Discord Package
import discord
Client (our bot)
client = discord.Client()
async def on_ready():
Do Stuff
general_channel = client.get_channel(877778689650200579)
general_channel.sent('hello dostoooo')
#run the client on discord server
client.run('sorry i can tell token')
see command
error
bruh
File "c:\Users\Admin\Desktop\python\real wale\my bot.py", line 9
general_channel = client.get_channel(877778689650200579)
^
IndentationError: expected an indented block
general_channel.send
see errror
yes
Indent it within your function, as you were told before
please learn basic python before making bots
i used this
no spoonfeed
how to indent
i am pro hacker
Press tab
lollllllll
Huh?
it is indent
I kinda wanna ping moderators
😐
oki
i didnt know that name i can also use : this
i am thanos
Bro go in discord.py server and type ?rule 11 i think
@graceful gorge how old are you?
?role 11
he would die in the dpy server
This is a help channel, if your not looking for actual help rather then just trolling us please goto general or off topic
just 4 years
In discordpy server
!ot
Off-topic channels
There are three off-topic channels:
• #ot0-psvm’s-eternal-disapproval
• #ot1-perplexing-regexing
• #ot2-never-nester’s-nightmare
Their names change randomly every 24 hours, but you can always find them under the OFF-TOPIC/GENERAL category in the channel list.
Please read our off-topic etiquette before participating in conversations.
Isn't this topical channel?
ok stop trolling, please go away
Seriously kid?
does anyone know how to start a vm from a phone remotely?
off-topic
i am of 34 why
lol
This is not the correct channel
@graceful gorge , it would be nice if you were serious. And keep it related to topic.
not dpy related
not working
yes bro
i want to start vm to run the dpy script
Bro i will help you tomorrow because I am not on pc now
Vm?
Hey @graceful gorge!
Uh-oh! It looks like your message got zapped by our spam filter. We currently don't allow .txt attachments, so here are some tips to help you travel safely:
• If you attempted to send a message longer than 2000 characters, try shortening your message to fit within the character limit or use a pasting service (see below)
• If you tried to show someone your code, you can use codeblocks
(run !code-blocks in #bot-commands for more information) or use a pasting service like:
virtual machine
why
that does not make it dpy related, the virtual machine part is pretty much a off topic.
Ohh
sure
where should i go?
Starting a vm from phone sounds off topic for me
.topic
none
Hey @graceful gorge!
It looks like you tried to attach file type(s) that we do not allow (). We currently allow the following file types: .gif, .jpg, .jpeg, .mov, .mp4, .mpg, .png, .mp3, .wav, .ogg, .webm, .webp, .flac, .m4a.
Feel free to ask in #community-meta if you think this is a mistake.
bro just stop
!warn @graceful gorge we'd appreciate if you stayed on-topic and contributed to the discussions in the channel instead of having off-topic conversations
:incoming_envelope: :ok_hand: applied warning to @graceful gorge.
Thanks
For warning
Bro do you know how can I invite my bot to this server?
u cant
^
what whyyyyyy
anyone would be able to nuke the server
yes
you can't, we do not allow public bots here
but you can always add new features to @lament depot if its good enoguh @amber imp
why
@novel apex is for discussing about infractions iirc @graceful gorge
continous shitposting
ok bro
my bot is working
nice
Or
Can i contribute in @lament depot bot project?
you can
yep, lemme get a link
.src
A guide to contributing to our open source projects.
the first link is the contributing guide
Thanks
if you would like to discuss your infractions, please contact us through modmail
why does my timestamp give wrong values
if you have any questions regarding @lament depot or any of our projects, you can use #dev-contrib
how do you set it?
Whats the time your giving it?
i use timestamp=datetime.now()
which works fine in other bots i've made, but doesnt in this bot
why is that
try: .utcnow() ?
¯_(ツ)_/¯
Okay
Thanks for your help
Hello, i have problem with making discord bot in python, I am trying to split Auto role and Welcome message, my code: ```Intents = discord.Intents(messages=True, guilds=True, reactions=True, members=True)
bot = commands.Bot(command_prefix = '-', intents=Intents)
@bot.event
async def on_member_join(ctx, member):
guild = bot.get_guild(----------------------)
channel = guild.get_channel(----------------------)
embed = discord.Embed(title="Nový člen!", description=(f'Vítej {member.mention} na arPlay discordu!'), color=0x66d9ff)
embed.set_thumbnail(url='https://i.imgur.com/laIDPip.png')
autorole = discord.utils.get(ctx.guild.roles, name = 'Member')
await ctx.add_roles(autorole)
await channel.send(embed=embed)I tried this:bot = commands.Bot(command_prefix = '-', intents=Intents)
@bot.event
async def on_member_join(ctx):
autorole = discord.utils.get(ctx.guild.roles, name = 'Member')
await ctx.add_roles(autorole)
@bot.event
async def on_member_join(member):
guild = bot.get_guild(----------------------)
channel = guild.get_channel(----------------------)
embed = discord.Embed(title="Nový člen!", description=(f'Vítej {member.mention} na arPlay discordu!'), color=0x66d9ff)
embed.set_thumbnail(url='https://i.imgur.com/laIDPip.png')
await channel.send(embed=embed)``` But when I used this, Autorole isn't work, please help me.
!code
Here's how to format Python code on Discord:
```py
print('Hello world!')
```
These are backticks, not quotes. Check this out if you can't find the backtick key.
remove ctx from on_member_join
event only lets you do it once, you need to use listen
it only has member
do not use ctx argument for event and you need to use member for that event.
oh nvm it was alrd explained
bot = commands.Bot(command_prefix = '-', intents=Intents)
@bot.event
async def on_member_join(ctx):
autorole = discord.utils.get(ctx.guild.roles, name = 'Member')
await ctx.add_roles(autorole)
@bot.event
async def on_member_join(member):
guild = bot.get_guild(835809421766164482)
channel = guild.get_channel(850829119713181748)
embed = discord.Embed(title="Nový člen!", description=(f'Vítej {member.mention} na arPlay discordu!'), color=0x66d9ff)
embed.set_thumbnail(url='https://i.imgur.com/laIDPip.png')
await channel.send(embed=embed)
wouldn't work because there are 2 of the same events
and wrong arg on first one*
you could use @bot.listen() instead of @bot.event
Thank you so much!!!!! Its workiing. You are GOD, thank you. 🙏
wat
are you using the first code?
Yes
oh
you are officially a god now
in that case, it should work with the correct naming
This, and its working :-) @bot.event async def on_member_join(member): guild = bot.get_guild(----------------------) channel = guild.get_channel(----------------------) embed = discord.Embed(title="Nový člen!", description=(f'Vítej {member.mention} na arPlay discordu!'), color=0x66d9ff) embed.set_thumbnail(url='https://i.imgur.com/laIDPip.png') autorole = discord.utils.get(member.guild.roles, name = 'Member') await member.add_roles(autorole) await channel.send(embed=embed)
I got this two times today
I'm just the better player
I see
this should work yeah
bot.event doesn’t allow 2 events or more with the same name
meh dpy coder is legend. Actually I dont know how is he doing it, but every time its working 😄
lmao
you can remove the brackets from
description=(f'Vítej {member.mention} na arPlay discordu!')
just so it looks nice
Surely he is a pro lol
Ok
this is kinda disturbing when they tell better programmers that someone is a god
hey i use heroku but when i run consol it say discord_components are not module
you have it in the requirements file?
add it to requirements.txt
does heroku allow a file to be shared between 2 accounts?
nop oh i forgot
can someone help me in #help-bagel ?
I should use off topic, my bad
Preocts already got the point
!ytdl
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)
I'm not using ydl or something like this
what are you using
My own music
wat
whats the command for printing out stuff from the txt file since when i do return line my bot doesnt display the output instead it says cannot send an empty msg
can you share the entire code
!paste
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.
Can someone help me with it?```py
if ctx.author.voice:
music = discord.utils.get(client.voice_clients, guild=ctx.guild)
channel = ctx.author.voice.channel
if not music.is_connected():
await channel.connect()
if ctx.author.voice.channel == ctx.guild.me.voice.channel:
if music.is_playing():
music.stop()
```Console: Command raised an exception: AttributeError: 'NoneType' object has no attribute 'is_connected'
I'm playing Fortnite 
I'm not sure if this isn't against rules
but your get() failed
what kind of object is music supposed to be
but my leave cmd is working with it
!d discord.ext.commands.Context.voice_client
property voice_client: Optional[VoiceProtocol]```
A shortcut to [`Guild.voice_client`](https://discordpy.readthedocs.io/en/master/api.html#discord.Guild.voice_client "discord.Guild.voice_client"), if applicable.
why don't u use this
this is off-topic
but you just
add discord_components to the file
wtf
you start a new line and type discord_components
and ?
ok ty
How do I get ctx.author's timezone
datetime.datetime.utcnow()
get is red marked
it's discord.utils.get
or you import it
but this isn't gonna fix anything
I want the bot user's timezone
how did you do it in the leave command
music = discord.utils.get(client.voice_clients, guild=ctx.guild)
if ctx.guild.me.voice.channel == ctx.author.voice.channel:
# leaving
elif not music.is_connected():
# says error
its a elif
so how is music NoneType in the first one
and not here
yeah
that's the fkn question
this come in heroku
can someone help me in #help-pear
you need to install that package
in heroku .... i wannna only bot 24/7 i use github for that
File name is same as user id but isn't working.
if(ctx.author.id == (file.replace(".png",""))):
Did you put that in the requirements file?
can u upload files?
how to do that ?
i am new in github things...
file*

@glad sleet
yes
Can you show me your working directory?
hmmm
Anyone knows how to get the object of ur own bot, for example if i want to make the bot mention itself, similar to a discord.Member class
Which all files do you have
bot
self.bot?
Where yu defined it
So, no one can help me with that?
requirement.txt
In requirement.txt add all the modules you've imported
With their versions
how just type it?
How do you change the discriminator to something like this? I just saw this bot with 0000 . Iirc, it's not possible to change it
Yes in different lines
Where yu initialized ur bot
oh u mean client.Bot?
You do @bot.commands yeah?
or whatever ur decorator is
Just do bot
Try bot.user
ok
Yeah, it should work
This too
!d discord.ext.commands.Bot.user
property user: Optional[discord.user.ClientUser]```
Represents the connected client. `None` if not logged in.
client.Bot.user?
What are you using? Client or bot?
client as my decorator
The object type?
Just do client.user then
You have to apply for it
to change the bots discimi
That's different. You need to set that when defining the client object
When I print ctx.author.id and (file.replace(".png","")) the outcome is the same but not working in this if statement, any idea?
if(ctx.author.id == (file.replace(".png",""))):
where
its a webhook
webhooks don't have a profile
wait really?
they do..
