#discord-bots
1 messages Β· Page 839 of 1
can somebody please help me with making this?
where i can put important peoples names in my code and the bot pings them once said in a text channel
important people meaning admins, owners, mods etc
so i can say the name without using a prefix
and i can say it in a sentence
i think u have to get a good pc to run the game with bot i think its soo hard
Bro can discord bot make tournament result
With gfx applied
Hmm
why isn't self.bot.avatar.url not working? is it self.bot.user.avatar.url?
using pycord 2.0b4
Yes
can somebody please help me with making this?
where i can put important peoples names in my code and the bot pings them once said in a text channel
important people meaning admins, owners, mods etc
so i can say the name without using a prefix
and i can say it in a sentence
!d discord.ClientUser.avatar
property avatar: Optional[discord.asset.Asset]```
Returns an [`Asset`](https://discordpy.readthedocs.io/en/master/api.html#discord.Asset "discord.Asset") for the avatar the user has.
If the user does not have a traditional avatar, `None` is returned. If you want the avatar that a user has displayed, consider [`display_avatar`](https://discordpy.readthedocs.io/en/master/api.html#discord.ClientUser.display_avatar "discord.ClientUser.display_avatar").
I missed the user then, thanks
can somebody please help me with making this?
where i can put important peoples names in my code and the bot pings them once said in a text channel
important people meaning admins, owners, mods etc
so i can say the name without using a prefix
and i can say it in a sentence
Also, how would i go about doing the cooldown thing though
@spring flax
this again
handle on_command_error
!d discord.ext.commands.Bot.on_command_error
await on_command_error(context, exception)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).
The default command error handler provided by the bot.
By default this prints to [`sys.stderr`](https://docs.python.org/3/library/sys.html#sys.stderr "(in Python v3.9)") however it could be overridden to have a different implementation.
This only fires if you do not specify any listeners for command error.
You need to override this (either using @bot.event, assigning bot.on_command_error to your own handler, or subclassing commands.Bot and writing your own on_command_error method)
Doing that to reinvoke..or?
Have you gone through resources?
well that way you can catch one of these errors and handle it instead of allowing the default implementation to just print the traceback
yes some
You should check whether exception is an instance of commands.CommandOnCooldown and then take it from there
I mean i don't get what's the difference between if isinstance(error, CommandOnCooldown)
!d discord.ext.commands.CommandOnCooldown
exception discord.ext.commands.CommandOnCooldown(cooldown, retry_after, type)```
Exception raised when the command being invoked is on cooldown.
This inherits from [`CommandError`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.CommandError "discord.ext.commands.CommandError")
And what was suggested to me*
What was suggested to you?
What you were saying
Compared to handling commandoncooldown on a local error handler
Using a local error handler for a pretty generic error like CommandOnCooldown is pretty pointless, why not implement it for every command?
My bot only has one command that has cooldown
Hello, My name is Calvin, I am working on a discord bot. I need to let the bot run 24 hours every single day, but I don't know how. I am using replit and spyder Anaconda as my programming platform, so it would be great if someone can tell me how to let my bot run 24/7.
sry wrong channel
uptime robot
how to do
No
Check out Oracle's free tier
Replit shouldnt be used for hosting
then what should I do?
wher to ask help for this
Oracle free tier
!d discord.on_message
discord.on_message(message)```
Called when a [`Message`](https://discordpy.readthedocs.io/en/master/api.html#discord.Message "discord.Message") is created and sent.
This requires [`Intents.messages`](https://discordpy.readthedocs.io/en/master/api.html#discord.Intents.messages "discord.Intents.messages") to be enabled.
Warning
Your botβs own messages and private messages are sent through this event. This can lead cases of βrecursionβ depending on how your bot was programmed. If you want the bot to not reply to itself, consider checking the user IDs. Note that [`Bot`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.Bot "discord.ext.commands.Bot") does not have this problem.
!d discord.Message.content
The actual contents of the message.
This channel is related to Discord Bots and is not an Introduction Channel. Thank you
Compare if the content is the message you're looking for
uh
example?
wdym
you need an example of how to do it?
yes pls
@Client.command()
async def test(ctx):
await ctx.send("hello")
await asyncio.sleep(20)
await ctx.send("thanks for using this bot")
how can I can make a function like this ?
def msgs():
await ctx.send("hello")
await asyncio.sleep(20)
await ctx.send("thanks for using this bot")
@Client.command()
async def test(ctx):
msgs()
but I am asking for help about dsicord bot
and I just want to make the bot run 24/7
@event or @commands.Cog.listener() or @listen("on_message")
async def on_message(message: discord.Message):
if message.author.id == bot.user.id: return
if message.content == "uwu": await message.channel.send("Hunter uwu")
lol I was kidding dude
anyone ?
so can u help?
This is you purposely making this harder than it has to be
um, first of all msgs is not asynchronous, after that, ctx is not defined
uh nvm, it seems easy to me rofl
Sure it does
anyone?
make an async function bruh
@slate swan ive just ruined something
aight i'll try
uh nvm, gazes gonna kill me, what happened?
i ran my code and now the bot isnt responding to anything and there arent any errors
did you put await bot.process_commands(message) inside your own_message event?
@client.event
async def on_message(message: discord.Message):
if message.author.id == client.user.id: return
if message.content == "uwu": await message.channel.send("Hunter uwu")```
this is what i have
await client.process_commands(message) after the second if statement
its alright
Do discord.py get updates ?
nope
would i use an f string to have multiple?
no?
oh
multiple statements
oh
@client.event
async def on_message(message: discord.Message):
if message.author.id == client.user.id:
return
if message.content == "something":
await message.channel.send("something")
i suggest doing this to help readibility
so, I suggest that if you have many triggers, make a different function and pass in the message parameter in that then import the file to your on_message file and use the function
I'm deliberately making it sound difficult than it is, welcome
didnt I do the same thing?
you put it in one line
that isnt gonna cause errors whatsoever
yes
who said it is though?
raven made it easier to read
nvm
read the bottom lol
uh its fine
I'm going blind
!f-string <-- this is what an f string does
Creating a Python string with your variables using the + operator can be difficult to write and read. F-strings (format-strings) make it easy to insert values into a string. If you put an f in front of the first quote, you can then put Python expressions between curly braces in the string.
>>> snake = "pythons"
>>> number = 21
>>> f"There are {number * 2} {snake} on the plane."
"There are 42 pythons on the plane."
Note that even when you include an expression that isn't a string, like number * 2, Python will convert it to a string for you.
client = commands.Bot(command_prefix='a!')```
When i use a command with that prefix, no response
first of all, can you change client to bot please
Lmao
second, if a command name is test, you should be doing a!test
@slate swan oh it worked thanks
Any prob with client?
Bad variable naming π
so do i make it commands.Client ?
No
Okay
I'mma pretend I ain't in the channel π
welcome
babye
What the sus
?
Normal for her to say that dw
a!test
do you have an on_message event
No
ok none of my command workin, showinn the which i tryin
@bot.command
@commands.has_permissions(manage_messages=True)
async def clearmsg(ctx, amount : int):
await ctx.channel.purge(limit=amount+1)```
@bot.command()
do @bot.command() not @bot.command
rofl
whats with the +1-
delete the command usage as well
what if someone messages after the command is run, it'll delete that message too
why would it?
nvm i'm gonna take it to another level
TY workin now
My mistake was so silly i changed entire code
i had to do a!clearmsg but i was doin a!purge
i forgot my command
all my command workin anyway now
Just stating facts
No lol it won't
sowwy π
So if I run like !purge 9, it will delete only 8 messages since one of them is the command message
So we add that 1 to delete 9 messages excluding the command message
when i did command, my command msg got deleted too
@bot.command()
async def delete(ctx, amount :int):
await ctx.channel.purge(limit=amount)
await ctx.send(f'Deleted {amount} message(s)', delete_after=5)
This is how I do it
That's the intended behavior
It deletes 9 messages including thr command message, if I run !delete 9
I created a kick command and now error comin that couldn't find command 'kick'
Code :
@bot.command()
@commands.has_permissions(kick_members=True)
async def kick(ctx, member : disnake.Member, *, reason=None):
await member.kick(reason=reason)
await ctx.send(f'Kicked {member.mention}')
await member.send("You have been kicked from the server, because:"+reason)```
yeah i use disnake library
First dm then kick, is what you should do
!d disnake.Member
class disnake.Member```
Represents a Discord member to a [`Guild`](https://docs.disnake.dev/en/latest/api.html#disnake.Guild "disnake.Guild").
This implements a lot of the functionality of [`User`](https://docs.disnake.dev/en/latest/api.html#disnake.User "disnake.User").
x == y Checks if two members are equal. Note that this works with [`User`](https://docs.disnake.dev/en/latest/api.html#disnake.User "disnake.User") instances too.
x != y Checks if two members are not equal. Note that this works with [`User`](https://docs.disnake.dev/en/latest/api.html#disnake.User "disnake.User") instances too.
hash(x) Returns the memberβs hash.
str(x) Returns the memberβs name with the discriminator.
ah, that make sense, I use pycord so it is discord.Member for me
Caps ^ discord.Member lol
@bot.command()
@commands.has_permissions(kick_members=True)
async def kick(ctx, member : disnake.Member, *, reason=None):
await member.send("You have been kicked from the server, because:"+reason)
await member.kick(reason=reason)
await ctx.send(f'Kicked {member.mention}')```
Now is it correct?
Wait imma try it
That'd only be a bit awkward when you try and kick an admin or where it raises discord.Forbideen
your first await is inside a bit
@bot.command()
@commands.has_permissions(kick_members=True)
async def kick(ctx, member : disnake.Member, *, reason=None):
await member.send("You have been kicked from the server, because:"+reason)
await member.kick(reason=reason)
await ctx.send(f'Kicked {member.mention}')
all are in a line
wait leeme run
a bot with no perms
Does it raise any error
You have an error handler?
yup
Show that
wait a big code came
after i ran command
like forbidden smth msg came
!hastebin
aaa
wait
Or wait actually
imma kick my alt
Idk if a bot can dm another bot
It cannot
I tried on my alt, it didn't work either
Error?
@kick.error
async def kick_error(ctx, error):
if isinstance(error, commands.MissingRequiredArgument):
await ctx.send("Please specify someone to kick.")```
My error handler didn't respond either
and error 403 : forbidden came in console
which line
Add that else to your current if
at end or between any specific line
@kick.error
async def kick_error(ctx, error):
if isinstance(error, commands.MissingRequiredArgument):
await ctx.send("Please specify someone to kick.")
else:
raise(error)
ok wait tryin
@bot.slash_command(guild_ids= guild_ids , name="kick" , description="BAN")
@commands.has_permissions(kick_members=True)
async def kick(ctx, member : discord.Member, *, reason=None):
await member.kick(reason=reason)
await ctx.respond(f'Kicked {member.mention}')
this worked for me
Mine ain't slash command
@bot.command()
@commands.has_permissions(kick_members=True)
async def kick(ctx, member : disnake.Member, *, reas
await member.kick(reason=reason)
await ctx.send(f'Kicked {member.mention}')
try this
Btw my command does not kick still
what's the error
it does not respond at all
oh wait
@bot.command()
@commands.has_permissions(kick_members=True)
async def kick(ctx, member : disnake.Member, *, reason=None):
await member.kick(reason=reason)
await ctx.send(f'Kicked {member.mention}')
try this one
You were trying to dm the user before kicking them
Okay so as i was going through my old project i found my old modmail bot, i put code in my new bot, it ain't workin
It's big, idk how to hastebin
from disnake.ext import commands
from disnake utils
import disnake
import asyncio
class onMessage(commands.Cog):
def __init__(self, bot):
self bot = bot
@commands.Cog.listener()
async def on_message(self, message):
if message.author.bot:
return
if isinstance(message.channel, disnake DMChannel):
guild = self.bot.get_guild(928108359641604186)
cate = utils.get(guild.categories, name = Modmail)
if no categ:
overwrites = {
guild.default.role : disnake.PermissionOverwrite(read messages = False)
guild.me : disnake.PermissionOverwrite(read_messages = True)
}
categ : await.guild.create_category(name = "Modmail", overwrites = overwrites)
channels = utils.get(categ.channels, topic str(message.author.id))
if not channel:
channel = await categ.create_text_channel(name = f"{message.author.name}#(message.author.discrminator", topic = str(message.author.id))
await channel.send("New Modmail created by {message.author.mention}")
embed = disnake.Embed(description = message.content, color = 0x696969)
embed.set author(name = message.author, icon_url = message.author.avatar_url)
await channel.send(embed = embed)
elif isinstance(message.channel, disnake.TextChannel)
if message.content.startsWith(self.bot.command_prefix):
pass
else :
topic = message.channel.topic
if topic:
member = message.guild.get_member(int(topic))
if member:
embed = disnake.Embed(description = message.content, color = 0x696969)
embed.set author(name = message.author, icon_url = message.author.avatar_url))
await member.send(embed = embed)
@commands.command()
async def close(self,ctx):
if ctx.channel.category.name == "Modmail"
await ctx.send("Deleting the channel in 5 seconds")
await asyncio.sleep(5)
await ctx.channel.delete
def setup(bot):
bot.add.cog(onMessage(bot))
Ok 2 word away from hastebin
!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.
cate = ...
#####
if not categ: #wrong variable name ```
You should really try running the code and based on the errors, fix what's wrong
can you edit my code and send?
aa
lot of errors
if isinstance(message.channel, disnake DMChannel):
guild = self.bot.get_guild(928108359641604186)
cate = Modmail
if not categ:```
@spring flax
I sent code of the part
Hello?
Not in a million years.
No documentation found for the requested symbol.
?
!d disnake.DMChannel
class disnake.DMChannel```
Represents a Discord direct message channel.
x == y Checks if two channels are equal.
x != y Checks if two channels are not equal.
hash(x) Returns the channelβs hash.
str(x) Returns a string representation of the channel
?
if isinstance(message.channel,disnake.DMChannel):
guild = self.bot.get_guild(928108359641604186)
cate = Modmail
if not categ:```
not workin
how do i make it overwrite them
use a cog error handler please
- why?
- not my code
when grouping your commands in a cog , it would be easier to use a cog handler that does all that work for all of the commands in there
here what it would look like
async def cog_command_error(self, ctx, error) -> Coroutine:
"""
A Cog error handler
---
arguements -> ctx discord.ctx
error is the procided error.
"""
view = View()
button = Delete_button(ctx)
view.add_item(button)
if isinstance(error, commands.CommandInvokeError):
error = error.original
if isinstance(
error,
discord.Forbidden,
):
return await ctx.send(
embed=discord.Embed(
title="oh no an error occured",
description="the bot doesnt have enough perms",
color=Colors.red,
),
view=view,
)
i use this for all of my mod commands its eassier than doing it manually for each command
when i type import discord it gives me a warning that the module is not found. how can i fix that? I am new to discord.py
did you install it to your current python version ?
yeah 3.10.2
can someone send link of dpy 2.0
specify the member and not the guild.default_role
how can i change the version?
User bots are against the ToS
are you using visual studio
e.add_field(name='Second id:', value='' + "<t:" + str(time0) + ":F>" + '', inline=False)
it doesnt seem to work
Pastebin
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
what python version are you using..?
timestamps only work in normal messages
they don't work in fonts like that
~~3.6+ but you still use concatenation ~~
yes
is there a possible fix
wdym
i suggest just removing them from the main code
if "createTime" in i:
time0 = i.split(":")[1][1:-2]
yes
Does βherokuβ cost?
no
Oh ok
Well how good is it?
its free so dont expect much
Alr
Ima test it out, I made a >uptime command. So will check that
you could use dtb
or epikhost
# member joining:
@commands.Cog.listener()
async def on_member_join(self, member):
channel = member.guild.system_channel
if channel is not None:
await channel.send(self.welcomeMessage[self.bot.index].format(str(member.mention)))
self.bot.index = (self.bot.index + 1) % 9
I have this simple welcoming message
now, can I exclude it X channels? [I want the bot to not send the welcome message in server X with channel Y]
if channel:
no
else:
send message to guild
h
if any("BadChannel" in channel.name for channel in guild.channels):
iterating through the channels to check if there's BadChannel in one of the channels' name
railway
!vps
reminder: free hosts can ratelimit you if they use a shared IP
heck
if "verified" in i:
verified = i.split(":")[1] "verified":false, it cant find the element
yeah, basically this 
answer = await self.bot.wait_for("message", timeout=120, check=lambda message: self.similar(message.content.lower(), trackname) or message.content.lower() == "stopgts" and ctx.channel == message.channel)
if answer.content.lower() == "stopgts":
await ctx.send("Cancelled.")
await self.MusicManager.skip(ctx, -10000000000000)
if answer.content.lower() in trackname:
await ctx.send(f"{answer.author.mention} got the answer correct! It was **{trackname}**")
await self.MusicManager.skip(ctx, -10000000000000)```
I'm trying to make it so that when someone guesses the song correctly, `if answer.content.lower() in trackname:` would happen
the reason why my if statement is if answer.content.lower() in trackname: because some songs has "feat" or "()" in the title and it won't work if the person doesnt include it
!e
print('song' in 'song()')
@leaden jasper :white_check_mark: Your eval job has completed with return code 0.
True
@wide tartan it works?
Its because the e isnt capital
!e ```py
print('Song' in 'song()')
@supple thorn :white_check_mark: Your eval job has completed with return code 0.
False
And the s
I did answer.content.lower()
Oh
But isnt that making the response lower
Which it should have capital
no, content.lower basically makes it case insensitive
did the wait_for() got triggered?
yeah
try printing answer.content
Is there any one here that knows how to make like where ur bot asks you questions from running the command in the discord server and then saves the info on the server and also sends you the results on the dm
If that make sense
If not here is a screenshot
And then the result will come out like this
Try removing the .content.lower() on the if statement for the trackname
And answer with capitals
Lower the trackname
what
What do you actually want
lower() makes it case insensitive, right? I need to include that
Lower makes it not capitals
So if you send this
HELLO
It gets turned into hello
async def tempban(self, ctx, *, args):
if "d" in args:
days = ''.join(re.findall("\d", args))
print(days)
if "h" in args:
hours = ''.join(re.findall("\d", args))
print(hours)```
yo im new to regex, right now this prints "1011" for both if statements if **10d 11h** is inputted, I need it to separate hours from days etc, anyone got a easy way to do this
not really
I've tested it before and it worked like that
!docs str.lower()
Fat chance.
No documentation found for the requested symbol.
str.lower()```
Return a copy of the string with all the cased characters [4](https://docs.python.org/3/library/stdtypes.html#id15) converted to lowercase.
The lowercasing algorithm used is described in section 3.13 of the Unicode Standard.
Make both trackname.lower() and answer.content.lower()?
doesnt work
No error?
nope
Can you print trackname.lower()
Yeah that might be better
hi guys how can i make per server welcome channel? if i create channel and i write !setwelcomechannel the bot get id for the channel
Which is which?
the first print is trackname and the second print is answer.content
oh
for the if statement?
so im assuming this?
answer = await self.bot.wait_for("message", timeout=120, check=lambda message: self.similar(message.content.lower(), trackname.strip().casefold() == answer.content.strip().casefold()) or message.content.lower() == "stopgts" and ctx.channel == message.channel)```
Probably a def
def similar(self, s_1, s_2): return SequenceMatcher(None, s_1, s_2).ratio() > 0.6```
guys i needed help with embeds. I have a few custom gifs i want to send in a embed on command. How do i do that?
@mental bloom
sir i need some help
not exactly sure
@nova summits
Bruh
Sorry
I just need a bot that changes my server name to something else every 2seconds
You can put the gif link in the embed and send the embed
Idk how do i make it
for comparing
@slate swan :white_check_mark: Your eval job has completed with return code 0.
False
I made a on_message event, and now my other commands stopped working.
I see
Oh but i saw a server do that and i dont think it happened to them
? I dont know why
No errors
Did you add process_commands?
no where do i need to put this
At the very end of the on_message event
ok thanks
hm
you shouldnt try self-botting
But those are againts TOC
Ikr we should not do self botting
My friends be like gaining couple million dank memers from self bots
im sure they'll understand once their accounts get disabled
Cant
Cause discord bypasses
It is even said in dank memer's ToS that usage of bots will lead to acc blocking
The bot shuts itself after randon hours
Dank memer has no safty features for that yk
Ik ik i dont know how to use self bots so i always stick with normal bots
Lol
That's pretty easy but nobody will tell you
And yeah let's drop the topic
Hey @jolly karma! 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!
why do they have the bot argument for booleans in bot.run() π€¨
or did they remove that when intents came
Dude it was a new discord bot token bruh
run(*args, **kwargs)```
A blocking call that abstracts away the event loop initialisation from you.
If you want more control over the event loop then this function should not be used. Use [`start()`](https://discordpy.readthedocs.io/en/master/api.html#discord.Client.start "discord.Client.start") coroutine or [`connect()`](https://discordpy.readthedocs.io/en/master/api.html#discord.Client.connect "discord.Client.connect") + [`login()`](https://discordpy.readthedocs.io/en/master/api.html#discord.Client.login "discord.Client.login").
Roughly Equivalent to...
@jolly karma :x: Your eval job has completed with return code 1.
001 | Traceback (most recent call last):
002 | File "<string>", line 1, in <module>
003 | NameError: name 'help' is not defined
i meant like bot.run("token", bot=False)
5. Do not provide or request help on projects that may break laws, breach terms of services, or are malicious or inappropriate.
Wydm by bot false?
Hi, is there a way I can check if a user is speaking in a Voice Channel? Like when the green circle is around that member when he talks?
@jolly karma :warning: Your eval job has completed with return code 0.
[No output]
-_-
Can i run shell?
@slate swan by the way, im assuming this is what you meant?
answer = await self.bot.wait_for("message", timeout=120, check=lambda message: (message.content.lower(), trackname.strip().casefold() == message.content.strip().casefold()) or message.content.lower() == "stopgts" and ctx.channel == message.channel)```
@wide tartan can you help?
?
I wanna make a bot that change dthe server name in some particularl time
in a loop?
Yeah
if you're saying every 2 seconds, please dont do that
2 seconds is definitely a 45 minutes API block
lol
No its oky it woukd be a cool way to delete my old server
You are not allowed to use that command here. Please use the #bot-commands channel instead.
Thats harsh
instead of answer.content.strip(), you meant message.content.strip()?
or you could do tasks.loop^
its not good to use time for sleep, use asyncio
await asyncio.sleep(2)
also make sure you import it
mhm since time is blocking
whatever goes
Why I can't install nextcord on replit?
Should I uninstall discord module first?
Please help
cogs so nice you can unload and load em after changed code and it updates β€οΈ
........and?
anyone know oracle hosting platform?
dude there is no such thing as good free hosting
mind sending the link to the site?
w h a t
what
is codegrepper a hacking site? π
why?
i just sent a link to my friend to ss everything in the codegrepper link in hopes of answers but they got hacked
so they blame it all on me
so anybody?
a try this in the video but the try not work
is it a scam? π
!d disnake.on_raw_reaction_add
disnake.on_raw_reaction_add(payload)```
Called when a message has a reaction added. Unlike [`on_reaction_add()`](https://docs.disnake.dev/en/latest/api.html#disnake.on_reaction_add "disnake.on_reaction_add"), this is called regardless of the state of the internal message cache.
This requires [`Intents.reactions`](https://docs.disnake.dev/en/latest/api.html#disnake.Intents.reactions "disnake.Intents.reactions") to be enabled.
its not disnake
reactin_add typo
reaction_add correct
And except not ex
What tutorial did you watch and what is your python knowledge
Works for dpy
goodness member can never be none in that case #tutorialsbad
Kinda sketchy 
You know the tutorial is bad when it has under 1k views
And he uses replit to write code 
lol
bruh codegrabber destroyed
heroku will work fine

Never recommend heroku. Never
lmfao yeah
use dpy buttons
you won't achieve anything with free heroku
upgrade to dpy beta
you gotta pay there too
and why json?
so i how to convert this to on_reaction_add
Just leave dpy with other shit stuff like discord components and upgrade to some decent fork
πΏ
hmmm i heard it wasn't good
What lib is that
any body?
most of the reasons it not being good is it doesn't scale well for big bots, if it is a really small bot heroku should work just fine
you won't get help with that, none using that crap
yeah it'll only be for one server
chill out
if you have no knowledge about this please don't confuse others who don't know
Rush get no knowledged
.
most of those reasons are only valid for big bots
π
no fork is decent lol

disnake, pycord have already all features discord pushed out
and don't dare to talk about hikari, assuming to you probably there's no decent python lib
pycord is shit
||pincer||
this i can agree with
i think everyone does

mhm
What about it is shit?
they claim danny's work as theirs hear-say + overrated
honestly i might just change to edpy/disnake in april
disnake
disnake is the most reasonable solution
pycord just got a bunch of children, overhyped it and made it crap
jerk
same with nextcord except nextcord hasnt done a single thing
theyre just changing namespace π€·ββοΈ
where do they claim that?
hikari is an insanely good option
hikari is better than the forks
because it isnt a fork
except disnake
hikari is a whole different library, quite meh idk, i don't like it
Why is everyone saying pycord is shit but then not saying what about it is shit
I'm just asking why everyone is calling it shit and now im a fanboy? xdd
is VSC a genius?
no
well yes but no
if isinstance(error, commands.CommandOnCooldown):
...
```in this if statement, error is gonna be typehinted to commands.CommandOnCooldown
how cool's that
hm
!d isinstance
isinstance(object, classinfo)```
Return `True` if the *object* argument is an instance of the *classinfo* argument, or of a (direct, indirect, or [virtual](https://docs.python.org/3/glossary.html#term-abstract-base-class)) subclass thereof. If *object* is not an object of the given type, the function always returns `False`. If *classinfo* is a tuple of type objects (or recursively, other such tuples) or a [Union Type](https://docs.python.org/3/library/stdtypes.html#types-union) of multiple types, return `True` if *object* is an instance of any of the types. If *classinfo* is not a type or tuple of types and such tuples, a [`TypeError`](https://docs.python.org/3/library/exceptions.html#TypeError "TypeError") exception is raised.
Changed in version 3.10: *classinfo* can be a [Union Type](https://docs.python.org/3/library/stdtypes.html#types-union).
Similar names: 2to3fixer.isinstance
it's still cool
uhmm

you didn't know this already lol
A basic python builtin functiln
Not sure why you'd think thats something with vsc
^ has nothing to do with vsc but more like python kek
because vsc handles typehints?
VSC doesn't handle type checking, you need to install an extension like Pyright for that
Pylance uses Pyright for typechecking
Under the hood, Pylance is powered by Pyright, Microsoft's static type checking tool.
yes but thats within visual studio code
therefore counted as visual studio code
its niiiiiiice
without visual studio code you wouldnt have that though
its niiiiiiice
yes you would, pyright isn't exclusive for vsc
smh
any IDE does that by default, or it should
vsc is just a text editor
with some plugins trying to be a legit ide

i said that earlier π’
Everybody hates us π«
or they just continuing the everyday discord bots channel rofl
wondering when okimii can come back
awh thanks (:
what happened to okimii
aw, you missing him?
he my homie
hello
hi
no
hi
@cold sonnet do you mean from discord.ext import commands?
hru?'
no
I mean that code is so wrong
!e import discord.py
it's blocking and rate-limiting
?
Hii
why does my about me look like that now
you should use checnge the await
pretty sure I didn't make that mistake
hru
I'm fine, hope you are too, !ot
what is?
hehe good to hear you are fine i am good too
the code I responded to
whatsup?
I thought you responded to my response
it's good now
lol
PLEASE use normal text
okay lol sorry
also im pretty sure you dont call when_mentioned in command_prefix
are you mod?
just asking bud
@jolly karma :white_check_mark: Your eval job has completed with return code 0.
cats are cute <3
How do I grab the webhook url for a channel using its ID?
why're you mad for no reason
I'm not mad?
channels don't have a webhook URL
!d discord.TextChannel.webhooks
await webhooks()```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).
Gets the list of webhooks from this channel.
Requires [`manage_webhooks`](https://discordpy.readthedocs.io/en/master/api.html#discord.Permissions.manage_webhooks "discord.Permissions.manage_webhooks") permissions.
uh
you get the channel
just go to the webhook and copy it from there
ic thanks
now ive done something for you, wanna change all my code to sqlite? π₯Ί
nah, I'm so messed up with sqlite, I dropped it in my own bot, even my old bot uses json
guys the user why not used?
nice
because you aren't using it
o i seee
did you make the help command?
class My1Help(commands.HelpCommand):
def get_command_signature(self, command):
return '%s%s %s' % ("!", command.qualified_name, command.signature)
async def send_bot_help(self, mapping):
embed = disnake.Embed(title="Help", colour=dh.color["blurple"])
for cog, commands in mapping.items():
filtered = await self.filter_commands(commands, sort=True)
command_signatures = [self.get_command_signature(c) for c in filtered]
if command_signatures:
cog_name = getattr(cog, "qualified_name", "No Category")
embed.add_field(name=cog_name, value="\n".join(command_signatures), inline=False)
channel = self.get_destination()
await channel.send(embed=embed)
it takes a command_attrs kwarg in it's __init__ ```py
command_attrs = {'hidden': True} #hidden makes the command hidden from the help command
can anyone help me with a bot that lags a server (i am not doing this for any wrong purpose just an educational project and finding bugs in discord)
nvm, I was being super dumb as usual, I literally looked up webhooks 10 minutes ago and forgot about them rn
its okay dude it happens
what u mean?
you can't lag a server
lol
but i can lag the device ig
Can I send an msg by just the id of a user?
yes
class Class(HelpCommand):
def __init__(self):
super().__init__(...)
hehe
LOL!
o.O
put the code I sent inside the other code that I said (in it's __init__)
also when the user isn't in the server of the bot
yeah, first get the member (Bot.get_member) then use the send method (User.send)
you can use top.gg api
!ot
Off-topic channel: #ot2-never-nesterβs-nightmare
Please read our off-topic etiquette before participating in conversations.
?

F.U.N.N.Y.
owh
Take a taste of your own medicine 
@boreal ravinethanks perfect!
π
!e print("help me");
oh yeah, How do I add options to slash commands in disnake ;-;
we don't do that here
You have to send a file aswell, i.e. await ctx.send(file=file, embed=embed)
now once you've sent that it's impossible to remove previous files, as far as i'm aware.
no
@jolly karmayou wanna do bughunting but asking for help for lagging a server for educational purpose MONKA
Options as in?
oh my god i didn't see the channel lol
I'm sorry π
hey whats the best way to make a temp ban command, cause like I was gonna check when a user tries to join and unba them but apparently there is no check for that
bruh no some bugs may appear when the server is lagging
no
idk if those exist anymore, like umm.....
idk how to explain
use await(time) then unban
hm
if the bot goes offline then rip
use a db and then check if time_now >= time_banned
any other suggests
or other way i forgot
then make it 24/7 online
database and task
doing that, but like
π
oh yeah a task
use database
yeah I got one, just need to figure how to constantly check with a "task"?
i use that but meh
check a table if there is a task
choices, was it?
oh god that looks not fun
!d discord.ext.tasks
var_name: str = commands.Param(choices=['Option 1', 'Option 2'])
self.lock = asyncio.Lock()
self.bulker.start() do I need this?
ah I see, ty
@kindred drumyou use cogs?
There is now a special extension for just creating background loops:
from discord.ext import tasks
@tasks.loop(seconds=5)
async def my_loop():
print('Hello World')
my_loop.start()```
The time until which the above loop will run is dependent upon human psychology, laws of energy and cosmos.
That is:
β’ You get bored of it
β’ The power goes down and your script stops working
β’ The universe explodes
Read more about it here: https://discordpy.readthedocs.io/en/latest/ext/tasks/ @kindred drum
this shit useful if you don't want users to input other things than they should, i kinda use it quite a lot
lmao, yeah
class myclass(commands.Cog):
def __init__(self, bot):
self.bot = bot
self.mytask.start()
def cog_unload(self):
self.mytask.stop()
@tasks.loop()
async def mytask(self):
#what u want to run
def setup(bot):
bot.add_cog(myclass(bot))
Is it possible to msg a user without sharing a serving with him?
no
sadly
yeah
uhm idk why after.activity doesnt return "test"```py
@client.event
async def on_member_update(before,after):
if after.activity == "test":
print("Yes")
print(after.activity)
activity returns the CustomAtivity for the member

i know
though what u doing in there it's weird
ok then you shouldn't have any problem handling it by yourself 
im making a bot that gives ppl who has "test" in their customstatus
OMG ididnt know that :l
i've been trying for like 1h
@hoary cargo uh.....this gives me type error?
or am I being too dumb as always
!d disnake.on_presence_update
disnake.on_presence_update(before, after)```
Called when a [`Member`](https://docs.disnake.dev/en/latest/api.html#disnake.Member "disnake.Member") updates their presence.
This is called when one or more of the following things change:
β’ status
β’ activity
This requires [`Intents.presences`](https://docs.disnake.dev/en/latest/api.html#disnake.Intents.presences "disnake.Intents.presences") and [`Intents.members`](https://docs.disnake.dev/en/latest/api.html#disnake.Intents.members "disnake.Intents.members") to be enabled...
i think this is what you are looking for
π
im using discor.py 1.7v
also on_member_update is the samething as on_presence_update
try to ```py
mode: str = . . .
eh? wdym?
on_member_update is used just for nicknames, roles or pending, not activity/status
yeah of course
so disnake has two different events
yeah...
on_member_update and on_presence_update?
oh i see
how do I keep the choices that way?
this is what i get
#bot-commands
that's weird, tbh never encountered that error and i use choices in many commands
so you store your choices in mode like
mode: commands.Param(choices=['Vent', 'Welcome or Leave'])
yeah, thats what I'm doing
what do I do now-
Don't add slash commands and request for message intent
wdym?
Wait u r making the slash command or ares?
me
in the docs it sais mode: str = commands.Param()
oh wow smh
Then stop making those and use simple text commands ezz
try add name
Heyo im here hello π
Hi
mode: str = commands.Param(name="something", choices=['Vent', 'Welcome or Leave'])
yeah, found it smh
you don't actually need a name though
π
you shaking ur head alot
lol
babyshake-syndrome
Baby shark tutururu baby shark 
Ot pls
- π how to get a list of all threads in a channel, not only the active ones that
channel.threadsseems returning?
Woah
i already reworked all my commands into slash 
ASM
ASM
L + Who are you
Use python
TypeError: tempbancheck() missing 2 required positional arguments: 'ctx' and 'member'
def __init__(self, bot: commands.Bot):
self.bot = bot
self.tempbancheck.start()
self.tempbancheck.start()
@tasks.loop(seconds=5.0)
async def tempbancheck(self, ctx, member: discord.User):
for i in range (0, len(Scammer_Items)):
for x in SFun_Items[i]:
if Fun_Items[i][x]['Expired'] == True:
pass
else:
unban_date = Fun_Items[i][x]['Date Expiration']
formatted_time = datetime.datetime.fromisoformat(unban_date)
if formatted_time < datetime.datetime.now():
Fun_Items[i][x]['Expired'] = True
await ctx.guild.unban(member)
else:
pass```
what am I doing wrong here
Arg
that's hell of a weird way of making an unban command
@kindred drumtask dosnt have ctx
seems like a hard language
do I add it?
is python and java still worth it?
!ot
Off-topic channel: #ot2-never-nesterβs-nightmare
Please read our off-topic etiquette before participating in conversations.
Weird var names
im talking about discord bot
why you want to make sounds like sending an embed into a different channel is hard
(not really a discord bot thing but this was the closest channel i could find) yk what would be cool, a third party program that can interact with your discord profile and make it so you can code in easter eggs and effects-
just and idea
@kindred drummake a command like u normaly does where u do ur tempban, and inside that add the discordID and datetime/unixtime to a database, and in your task select all tempbans from db and check if time is more than what u want a tempban to be, etc etc
Off-topic channel: #ot2-never-nesterβs-nightmare
Please read our off-topic etiquette before participating in conversations.
{
"796053067254595594": {
"Discord Name": "tomee",
"Duration": "1m",
"Date Issued": "2022-02-19 13:59:05.203049",
"Date Expiration": "2022-02-19 14:00:05.203049",
"Banned by": "mictony",
"Reason": "test",
"Proof": "test",
"Expired": false
}
}
]``` @honest vessel
does that not break the TOS?
thats it currently, should I just grab the user from the id
Proof
and unban them that way?
use ids
i had never thought about that aspect π
but then again better discord is still a thing
I have a big wuestion do mute commands edit time every sec
if (user.name, user.discriminator) == (member_name, member_discriminator): to if user.id == member.id: ?
if time == 0:
member.remove_role()
Tuple
you can fetch the user, though it requires member intents
Do disnake support timeouts
yes @nimble plume
Why use mute then??
you dont π
!!
can someone tell me which is easy to code a discord bot
Python
lol you are in a python server
π
He is very new
any guide to make a discord bot from 0?
yes many
but some people said javascript
Yes python is simple
i dont think js is simpler tho but i guess its more about preferances
Disnake gives all js stuff
just get ready for module.exports and endless consts and lambdas
Didnt understand
Js is pure hell
ok so what i do to code
^^^
buritos
Learn python or js first
depends
And global variables
do you want to do web dev?
ok
I started with python
!resources
Resources
The Resources page on our website contains a list of hand-selected learning resources that we regularly recommend to both beginners and experts.
imagine learning c++ as your first language
Hehe
Instant rage quit
Toatally not usefull to me
ok but i only want for bot coding
Yes use python
U should learn basics first
Yes
it was not meant to you
ok
Bot development isnt rly begginers field
ok
i did :S
At least know oop
When i was new people do !resources
but i gave up pretty fast n found python, then i wentback to c++ littlebit ^^,
@nimble plume can you give me any good yt video that i can see it
about python or what
U know hindi right
std::cout << "c++ is hard :(";
yes
std::cout << "c++ is hard :(" << std::endl;
U can go watch codewithharry its hindi tuorials are great
!ot
Off-topic channel: #ot2-never-nesterβs-nightmare
Please read our off-topic etiquette before participating in conversations.

@slate swan
we don't talk c++ here sir
std::cin >> python;
Huh?
bro u also first lern python
print('Doubt')
Yes
ok u have any type of code like dyno with dashboad
I wonder where these guys call these functions
No.
π₯ β
so why u right dyno ka bhai
what
i'm amazed how people want to do advanced stuff in a language they don't even know
π
If I have multiple scheduled task is it a good practice to handle these in the bot cogs directly, or I should organize these outside of the bot? This is how I do it now:
`class FplCogs(commands.Cog, name="CogGrp1"):
def init(self, bot):
self.bot = bot
@aiocron.crontab('* * * * *')
async def cronjob3():
matches = pd.read_sql('SELECT * FROM [dbo].[DoesntReallyMatter]', cnxn)
pulseid_list = matches['pulse_id']
if len(pulseid_list.index) != 0:`
@nimble plume u know coding right
Ye
ok
Ok.
@nimble plume u know the javascript is so hard to learn
Why not schedule cron tasks in the bot class, if you are subclassing
Itβs not though
I could prolly learn it in a week if I committed
Js is easy like python
guys how can i use emoji in button?
yes
bruh
!d discord.ui.Button
the devs
