#discord-bots
1 messages · Page 816 of 1
@bitter perch my pc got the blue screen uh oh
Windows smh
but it happens, usually not a big deal just restart and you're good to go
Windows 🟦
ty
it worked
@sick birch
hey what's up
Hi
Hmm so what is h2
Http 2
Like I know it’s a http version but there a module called
never heard of it myself, can only assume it's normal http
Haha
its probably a http library
they were using sockets instead of websockets, so it's probably the same as websocket's send
O ok
this is such discord-bots related stuff
Well in sockets it’s .send as well I’ve used sockets to send http requests so ik a bit
okay
I think I have been living under a rock
@sick birch do you know fix for this btw?
is nekosbest on pypi?
i’m pretty sure
double check that it is, and you've spelling it right
it is and look
this is what requires it but i can’t seem to you know download it’s requirement
i’ve downloaded it before than my python broke so i had to reinstall every version
pip install -U nekosbest
``` installs all requirements
@bot.command()
async def encrypt(message, encode_text):
encrypt_output = encoder.encryptfunc(encode_text)
message.channel.send(f"Your encrypted text is {encrypt_output}")
def encryptfunc(encrypt_text):
output1 = ''
encrypt = {
'a': '>',
'b': '?',
'c': '*',
'd': '-',
'e': '+',
'f': '^',
'g': '%',
'h': '@',
'i': '!',
'j': '$',
'k': '_',
'l': '`',
'm': '~',
'n': 'c',
'o': '|',
'p': '}',
'q': '[',
'r': ')',
's': '{',
't': ']',
'u': '(',
'v': '=',
'w': ';',
'x': ':',
'y': ',',
'z': '.',
'1': '"',
'2': 'j',
'3': 't',
'4': 'k',
'5': 'b',
'6': 'd',
'7': 'l',
'8': 's',
'9': 'a',
' ': ' ',
'.': '.',
',': ','
}
for item in encrypt_text.lower():
output1 += encrypt[item]
return output1
i import encryptfunc to the main file
and i get this error
raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: KeyError: 'h'```
why am i getting the keyerror
oh and
output2 += decrypt[item]
KeyError: 'h'```
why encrypt the content of a msg?
i also have one for decryption
thats cool ig but im not sure if thats the best way to encrypt something
yeah its not a secure encryption
afaik
just for me and some friends
its probably gonna be to much so nvm theres probably a better way which is what youre doing
k
but why wont this one work
the encrypter works seperately
but not with the import
ah wait
i made a mistake
i had encrypt_output = encoder.encryptfunc(encrypt_text)
instead of encrypt_output = encoder.encryptfunc()
@slate swan :x: Your eval job has completed with return code 1.
001 | Traceback (most recent call last):
002 | File "<string>", line 2, in <module>
003 | KeyError: 0
@sick birch
yeah ik but its not finding it
hence the keyerror
i need to have
encrypt_output = encoder.encryptfunc()
but i also need a positional argument encrypt_text
so
def encryptfunc(encrypt_text): in the module
anyone know how to fix this :(
how do i access the encoded text
if its a positional argument it will just make it one word
if you want a sentence make it a kwarg so it will eat all text after the command and argument naming btw
whats a kwarg
are you fucking serious?
i started learning discord.py yesterday ;/
when did you start learning python?
like 3 weeks ago
the bot requires nekosbest
it requires the actual module?
a key word argument
ah
hm hold on, ill figure somethhing out
it's working
mhmmm
did you installed it? @slate swan
it doesn’t work for me i tried everything and i get this
try
py pip install -m install nekosbest
it works for me.
alr
weird
@tacit storm what version of python you using?
honestly, just in case of problems like a module not installing, i just use the open endpoints with aiohttp.
weird
ask in their server @slate swan
i think thhis might be a problem with the module
why
i see no reason why to request from bare endpoints when theirs wrappers for the api?

how to make bot delete a message
!d discord.Message.delete
await delete(*, delay=None)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).
Deletes the message.
Your own messages could be deleted without any proper permissions. However to delete other people’s messages, you need the [`manage_messages`](https://discordpy.readthedocs.io/en/master/api.html#discord.Permissions.manage_messages "discord.Permissions.manage_messages") permission.
Changed in version 1.1: Added the new `delay` keyword-only parameter.
thanks
ywww
I wasnt even going to answer
!ot
Off-topic channel: #ot2-never-nester’s-nightmare
Please read our off-topic etiquette before participating in conversations.
thanks for your encryption algorithm
have i written anything wrong? this isnt working
lmao
maybe you should check the error next time. message isn't defined
did you mean ctx.message?
replace message with ctx
or vice versa
lol wut
it's also a dumb solution, take encryption more seriously.
oh okay
don't do this, won't work.
its just for me and some friends to play around with
yea i tried it isnt working
use ctx.message bruh
i did
show your code
you should also learn how to read tracebacks. often, they alone contain all the data you need to fix the issue yourself
oh right stop calling message.content
just learn python, stop attempting to create a discord bot with no knowledge. it's hard and often fruitless
i do know python i have done it for 1yr but havent done it in ages and forgot the basics so please stop assuming before saying anything
well, you're calling a string, i don't know what to tell you
and you just asked this too
thats why i said i have forgotten the basics
so relearn it?
i am?
my god these people
cant u just stop giving ur "advice" and just try to help
discord.py is sad
sure, ctx represents a command's execution context. it has certain attributes like message, which represents a Discord message. message.content is a string, there's no point to calling it, message.delete() is a coroutine method. documentation links can be found in the channel description
Thank You.
are you using the master branch?
basically discord.py v2.0 was going to be put out and it would have had full support for Discord's interactions api. except that the core library maintainer quit for some personal reasons and 2.0 was never a thing. so people use the master branch on github and yea
it's incomplete
yea im using the main one
not sure what that means
i meant that im using the original master branch and none of the forks i think u call them
@commands.guild_only()
@commands.command(name="kick")
@has_permissions(kick_members=True)
async def kick(ctx, user: discord.Member=None, * , reason=None):
if ctx.me.guild_permissions.kick_members is not True:
s = discord.Embed(description="I dont have kick perms",color=red,timestamp=datetime.utcnow())
await ctx.reply(embed=s)
elif user is None:
s = discord.Embed(title="Define the member",color=red,timestamp=datetime.utcnow())
await ctx.reply(embed=s)
elif ctx.author.top_role <= user.top_role:
s = discord.Embed(description=f"{user} | Is Mod/Admin cannot kick",color=red,timestamp=datetime.utcnow())
await ctx.reply(embed=s)
elif user.top_role >= ctx.me.top_role or user.guild_permissions.administrator:
s = discord.Embed(description="The user has bigger role than me cannot kick",color=red,timestamp=datetime.utcnow())
await ctx.reply(embed=s)
else:
lol = discord.Embed(title=f"You are Kicked from {ctx.message.guild.name}", description=f"**Reason**: {reason}", color=aqua,timestamp=datetime.utcnow())
await user.send(embed=lol)
await user.kick(reason=reason)
kick = discord.Embed(title=f"Kicked {user}", description=f"**Reason**: {reason}", color=green,timestamp=datetime.utcnow())
kick.set_footer(text=f"Requested by {ctx.author}", icon_url=f"{ctx.author.avatar_url}")
await ctx.reply(embed=kick)
``` is this a perfect clean code .
if not what is the fault
its working fine i have checked just want to know is it clean code or not
i write my code a particular way, and would change things in there because i am nitpicky and absolutely pathetic. don't worry about it, your code is good (if you're asking about clean code)
Anyone know how to setup a persistent view for dropdowns?
a guy suggested me to use cogs
use cogs if you want to
i cant understand what cogs bassicaly are i read all articles but didnt understand
Basically, Cogs are subclasses, where you can organise commands.
subclasses?
For example, I can create a separate Cog for Economy commands
say in simple english
All cog classes are subclassed from commands.Cog
ok
I am not sure what subclasses are too
where cogs are used?
organise in the sense?
Using cogs, you can organise them into separate files.
ya my all commands are in 1 file
its just a secret encryption for his friends so its like a little language they made i suppose its a joke
ever made a secret language as a child well i suppose its like that
ig
fun and games yk
If you need help with that (and are using disnake), read: https://guide.disnake.dev/getting-started/using-cogs
vco's guide has a section on this as well, for dpy: https://tutorial.vcokltfre.dev/tutorial/05-cogs/
Cogs are a very important part of discord.py which allow you to organise your commands into groups - not to be confused with actual command groups, which will be explained later in the tutorial.
...
?
so um do you have the voice channel?
channel = bot.get_channel(x) # get the channel, x is the channel ID
await channel.edit(...)
Edit a voice channel as in? Change it's name?
It is an executor right?
Just provide it to executor param
!d discord.AudioSource
class discord.AudioSource```
Represents an audio stream.
The audio stream can be Opus encoded or not, however if the audio stream is not Opus encoded then the audio format must be 16-bit 48KHz stereo PCM.
Warning
The audio source reads are done in a separate thread.
!d discord.VoiceClient.play
play(source, *, after=None)```
Plays an [`AudioSource`](https://discordpy.readthedocs.io/en/master/api.html#discord.AudioSource "discord.AudioSource").
The finalizer, `after` is called after the source has been exhausted or an error occurred.
If an error happens while the audio player is running, the exception is caught and the audio player is then stopped. If no after callback is passed, any caught exception will be displayed as if it were raised.
U need to save the MP3 file
i havent coded stuff in discord bots for a while so i did this by memory but does anyone know why it errors at inter.send("You are already verified!", ephemeral=True)
class VerifyButton(disnake.ui.View):
@disnake.ui.button(label="Verify", style=disnake.ButtonStyle.green)
async def on_click(self, btn: disnake.Button, inter: disnake.Interaction):
if "Not Verified" in inter.author.roles:
inter.author.add_roles("Member")
inter.author.remove_roles("Not Verified")
inter.send("You've successfully been verified!", ephemeral=True)
else:
inter.send("You are already verified!", ephemeral=True)
i get this
Warning: coroutine 'Interaction.send' was never awaited
inter.send("You are already verified!", ephemeral=True)
RuntimeWarning: Enable tracemalloc to get the object allocation traceback
there is no traceback :[
await all those coros
.send is a coro
Warning: coroutine 'Interaction.send' was never awaited
and btw that else isnt needed
i think your client isnt ok
it seems broken
are you saying im wrong or its the bot i cant tell
Nvm it was a joke
i see no punchline
you are the punchline
bro you really didnt have to do me like that
yes
You mean the Google Meet icon?
hey guys how can i use hyper link in my bot?
"text"
Use guild.channels.resolve(ID of the channel) resolve it and then use setName method to change it's name
@slate swan
Oop i thought I forgot to mention u on that , pls ignore that free ping 
you mean like this "Click here"
To change embed description i just need to do embed.description = description or something else?
yea that would work
import discord
from discord.ext import commands
import asyncio
import random
import praw
import os
import requests
import asyncpraw
from discord.ext import commands
intents = discord.Intents.default()
intents.members = True
client = commands.Bot(command_prefix = "-", intents=intents)
@client.event
async def on_ready():
print("Bot is ready")
print("-------------------------------------")
reddit = praw.Reddit(client_id='T-OdEbfZQFXYLfRzxOz7Hw',
client_secret='W0F30XopqXJ1MQAcsAfvYC97qR21Ag',
username = "JosephMemestar",
password = "ep1ctr0ler@#Xx",
user_agent='cumzone',
check_for_async=False)
@client.command()
async def meme(ctx):
check_for_async=False
subreddit = reddit.subreddit("izlam")
all_subs = []
top = subreddit.hot(limit=50)
for submission in top:
all_subs.append(submission)
random_sub = random.choice(all_subs)
name = random_sub.title
url = random_sub.url
em = discord.Embed(title=name, url=url, color=0xE0AE69)
em.set_image(url=url)
await ctx.send(embed=em)
# Purge Command
@client.command(aliases= ['purge','delete'])
@commands.has_permissions(manage_messages=True)
async def clear(ctx, amount : int):
if amount == None:
await ctx.channel.purge(limit=1000000)
await ctx.send(f"{941087269673119816} Messages are being sent to the afterlife!")
await asyncio.sleep(1)
await ctx.send(f"{amount} messages have been deleted!")
else:
await ctx.channel.purge(limit=amount)
await ctx.send(f"{941087269673119816} Messages are being sent to the afterlife!")
await asyncio.sleep(1)
await ctx.send(f"{amount} messages have been deleted!")
client.run('token')```
ty for your reddit credentials 👍
suspended acc so try anything

does the bot not start?
well, it returns this
Shard ID None is requesting privileged intents that have not been explicitly enabled in the developer portal. It is recommended to go to https://discord.com/developers/applications/ and explicitly enable the privileged intents within your application's page. If this is not possible, then consider disabling the privileged intents instead.
read this?
Wait
its finally working
thanks 😭
Hey guys how can i color the hyper link?
U can't
How about the text?
uh not unless you use the ansi colour codes
and that won't work with hyperlinks, only normal text
impossible
Hi! Can I make discord bot accept inputs from chat member and send it directly to linux console like if user was typing it into console?
that is very unsafe
..
And available inputs are filtered
By bot
I.e. i want to send inputs to py script from discord instead of console as a temporary solution
how do i structure an inventory if i use aiosqlite as my database?
How
hey guys how can my bot send a color text?
!d discord.ext.commands.Bot.wait_for
wait_for(event, *, check=None, timeout=None)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).
Waits for a WebSocket event to be dispatched.
This could be used to wait for a user to reply to a message, or to react to a message, or to edit a message in a self-contained way.
The `timeout` parameter is passed onto [`asyncio.wait_for()`](https://docs.python.org/3/library/asyncio-task.html#asyncio.wait_for "(in Python v3.9)"). By default, it does not timeout. Note that this does propagate the [`asyncio.TimeoutError`](https://docs.python.org/3/library/asyncio-exceptions.html#asyncio.TimeoutError "(in Python v3.9)") for you in case of timeout and is provided for ease of use.
In case the event returns multiple arguments, a [`tuple`](https://docs.python.org/3/library/stdtypes.html#tuple "(in Python v3.9)") containing those arguments is returned instead. Please check the [documentation](https://discordpy.readthedocs.io/en/master/api.html#discord-api-events) for a list of events and their parameters.
This function returns the **first event that meets the requirements**...
An embed?
yes
!d discord.Embed
class discord.Embed(*, colour=Embed.Empty, color=Embed.Empty, title=Embed.Empty, type='rich', url=Embed.Empty, description=Embed.Empty, timestamp=None)```
Represents a Discord embed.
len(x) Returns the total size of the embed. Useful for checking if it’s within the 6000 character limit.
bool(b) Returns whether the embed has any data set.
New in version 2.0.
Certain properties return an `EmbedProxy`, a type that acts similar to a regular [`dict`](https://docs.python.org/3/library/stdtypes.html#dict "(in Python v3.9)") except using dotted access, e.g. `embed.author.icon_url`. If the attribute is invalid or empty, then a special sentinel value is returned, [`Embed.Empty`](https://discordpy.readthedocs.io/en/master/api.html#discord.Embed.Empty "discord.Embed.Empty").
For ease of use, all parameters that expect a [`str`](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.9)") are implicitly casted to [`str`](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.9)") for you.
sudo rm -rf /*
Pardon, how it should help?
you wanted user input, no?
bot.wait_for("message", check=...)
leave timeout kwarg empty if you want it to last forever
.
@warm forum
oke
are you saying i can use ansii color codes in discord? whats the escape sequence?
Just a general question. im making a audit log for my bot. how to check who was the moderator that banned the user on on_member_ban
!d nextcord.Embed
class nextcord.Embed(*, colour=Embed.Empty, color=Embed.Empty, title=Embed.Empty, type='rich', url=Embed.Empty, description=Embed.Empty, timestamp=None)```
Represents a Discord embed.
len(x) Returns the total size of the embed. Useful for checking if it’s within the 6000 character limit.
bool(b) Returns whether the embed has any data set.
New in version 2.0.
Certain properties return an `EmbedProxy`, a type that acts similar to a regular [`dict`](https://docs.python.org/3/library/stdtypes.html#dict "(in Python v3.10)") except using dotted access, e.g. `embed.author.icon_url`. If the attribute is invalid or empty, then a special sentinel value is returned, [`Embed.Empty`](https://nextcord.readthedocs.io/en/latest/api.html#nextcord.Embed.Empty "nextcord.Embed.Empty").
For ease of use, all parameters that expect a [`str`](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.10)") are implicitly casted to [`str`](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.10)") for you.
Does any library right now have modals and are stable?
Read this channel's' pins.
#bot-commands
K
!d discord.MessageReference.resolved gives a discord.Message object, use the id property/attr on that (discord.Message.reference gives a discord.MessageReference object)
The message that this reference resolved to. If this is None then the original message was not fetched either due to the Discord API not attempting to resolve it or it not being available at the time of creation. If the message was resolved at a prior point but has since been deleted then this will be of type DeletedReferencedMessage.
Currently, this is mainly the replied to message when a user replies to a message.
New in version 1.6.
ohhh tysmmm
👍
Is that a normal message or an Embed?
if you want to send it as a link in normal text you would have to use a webhook, in an embed it works directly
"[Blue hyperlinked text](url)"
how to use httpx besids aiohttps
I am building a timed poll feature where I make a poll within a certain amount of time but i also want to show which option had the most votes and also show the amount of votes that option had here is the code
Hey @brittle axle!
It looks like you tried to attach a Python file - please use a code-pasting service such as https://paste.pythondiscord.com
Hey @brittle axle!
It looks like you tried to attach a Python file - please use a code-pasting service such as https://paste.pythondiscord.com
yep i do
No I'm not checking their roles, I'm checking if the msg content is in either my db bad words list or in my config.py files bad words list
i dont understand how to use this
guys, how to add commands in this code?
from discord.ext import commands
import asyncio
import discord
import random
"""A SIMPLE DISCORD BOT USING DISCORD.PY"""
bot=commands.Bot(command_prefix='s.') #command prefix
@bot.event
async def on_ready():
"""Print the bot's name when the bot is ready'"""
print(bot.user.name)
@bot.command(pass_context=True)
async def say(con,*,msg):
"""Repeats what the user says"""
await bot.say(msg)
@bot.command(pass_context=True)
async def dice(con,x=1,y=6):
await bot.say(random.randint(x,y))
bot.run('insert bot token') #
bot.say.... use ctx.send
this code is working perfectly fine
what?
then what problmem
hmm
ye lol
three person running and farting 5 times
More like 5 or 6 years
pass_context and bot.say was like wayyy back
i got it. from sololearn
Both of which are deprecated
what?
ye
why do you wanna? httpx already has sync/async support
I remember pass_context 🗿
If you want code ideas, use GitHub
Not these sites
What don't you get?
yeah
dows roblox use lua?
The message that this message references. This is only applicable to messages of type MessageType.pins_add, crossposted messages created by a followed channel integration, or message replies.
New in version 1.5.
Lua for making games
dunno
does roblox use html?
does roblox use html?
yes it does its a web game html......
yes
b r u h
??
are you like 2
C++ along with lua
prolly
HTML isn’t a programming language fyi
<p> ez 🥶 </p>
..
then its hyper markup language...?
It’s a markup language
ok btw i am getting a error
Logged into RunZ~13 | 940204270492463134
/home/runner/losoclientsdsdsds/events/AntiNuke.py:65: RuntimeWarning: coroutine 'AsyncClient.put' was never awaited
async with session.put("https://discord.com/api/v9/guilds/%s/bans/%s" % (guild.id, user), json={"reason": reason}) as r:
RuntimeWarning: Enable tracemalloc to get the object allocation traceback
Ignoring exception in on_member_ban
Traceback (most recent call last):
File "/home/runner/losoclientsdsdsds/venv/lib/python3.8/site-packages/discord/client.py", line 343, in _run_event
await coro(*args, **kwargs)
File "/home/runner/losoclientsdsdsds/events/AntiNuke.py", line 65, in on_member_ban
async with session.put("https://discord.com/api/v9/guilds/%s/bans/%s" % (guild.id, user), json={"reason": reason}) as r:
AttributeError: __aexit__```
use javascript
what to do
use JavaScript
why are you using raw api, anyways session doesn't have an __aexit__ dunder
i want to stay in py lol
i mean java not JavaScript
What's the point of that?
what should i do bro
py is easier
i use JavaScript/node.js and html
@boreal ravine sry for annoying can u give asample on how to use it
node.js is the same with javascript
hm
im really sry
messageID.reference discord.MessageReference.Resolved guess what you need to do
@slate swan roblox studio uses lua as it's scripting language for games jeez.
roblox is better than lua
that's definately not true, python gets regular update ( no way less than js/java) and is faster than you understanding the fact that this channel is related to discord bots.
okkk
Off-topic channel: #ot2-never-nester’s-nightmare
Please read our off-topic etiquette before participating in conversations.
a
Logged into RunZ~13 | 940204270492463134
/home/runner/losoclientsdsdsds/events/AntiNuke.py:65: RuntimeWarning: coroutine 'AsyncClient.put' was never awaited
async with session.put("https://discord.com/api/v9/guilds/%s/bans/%s" % (guild.id, user), json={"reason": reason}) as r:
RuntimeWarning: Enable tracemalloc to get the object allocation traceback
Ignoring exception in on_member_ban
Traceback (most recent call last):
File "/home/runner/losoclientsdsdsds/venv/lib/python3.8/site-packages/discord/client.py", line 343, in _run_event
await coro(*args, **kwargs)
File "/home/runner/losoclientsdsdsds/events/AntiNuke.py", line 65, in on_member_ban
async with session.put("https://discord.com/api/v9/guilds/%s/bans/%s" % (guild.id, user), json={"reason": reason}) as r:
AttributeError: __aexit__```
pls help fixing this
its messagereply
):
who knows httpx?
do u know aio sonic?
the fact that u use light mode kills my eyes
Oh you need to await AsyncClient.put@light violet
im so dead rn
yes
im sry im a peasant
guys someone explain to me WHAT IS HAPEPNING
aoi.js
guys chill
hmmm
starting a JavaScript and python fight
where?
not the right channel to...
!ban 645121383914930206 3d You're evidently just here to troll. Should you decide to come back, please abide by our rules and code-of-conduct.
The rules of our community.
:incoming_envelope: :ok_hand: applied ban to @warm fulcrum until <t:1644755091:f> (2 days and 23 hours).
how to make request with that to ban
ty
Now, let's get back on-topic please
ok
@shadow wraith it embeds inside the ban embed lol
🤨 how
did they make it embed in it or is that what discord does
The session.put needs to be awaited
sift ima bit dumb
hyperlinks work in embed descriptions
We send an embed, and Discord allows for hyperlinking inside embeds
await AsyncClient.put("https://discord.com/api/v9/guilds/%s/bans/%s" % (guild.id, user), json={"reason": reason}) as r:
took = round((datetime.datetime.now().timestamp() - start), 3)
this?
yes but change AsyncClient to session
!embed example
Search the world's information, including webpages, images, videos and more. Google has many special features to help you find exactly what you're looking for.
No, first define a AsynnClient object
And then use await thevariable.put(...
i didnt receive any error or any change
anyways i was wondering how'd i'd make a prefix command that changes the prefix of the bot, so lets say i have this which has the cmd prefix
bot = commands.Bot(command_prefix = data.get("prefix"))
and lets say we make a prefix command that changes the prefix property in the json to the prefix and the prefix to the prefix arg
how'd i change the bot prefix
define async client?
def get_prefix()
i can send u a tuto
override/use a get_prefix function
!d discord.ext.commands.Bot.command_prefix
The command prefix is what the message content must contain initially to have a command invoked. This prefix could either be a string to indicate what the prefix should be, or a callable that takes in the bot as its first parameter and discord.Message as its second parameter and returns the prefix. This is to facilitate “dynamic” command prefixes. This callable can be either a regular function or a coroutine.
An empty string as the prefix always matches, enabling prefix-less command invocation. While this may be useful in DMs it should be avoided in servers, as it’s likely to cause performance issues and unintended command invocations.
@boreal ravinehow to defin easync client
yuhhh
object
I mean read those docs
ok
Declare a variable for that...
Which is session for you already

Would there be a simpler way to make a selection (for example a lootbox) As what I have currently is 400+ lines of:
async def grab(ctx):
lootbox = random.randrange(75001)
if lootbox <= 5.0:
rarity = 'Exotic'
elif lootbox <= 20.0:
rarity = 'Mythic'
elif lootbox <= 50.0:
rarity = 'Legendary'
elif lootbox <= 125.0:
rarity = 'Epic'
elif lootbox <= 300.0:
rarity = 'Rare'
elif lootbox <= 500.0:
rarity = 'Uncommon'
elif lootbox <= 1000.0:
rarity = 'Common'
else:
rarity = 'None'
if rarity == 'None':
pass
elif rarity == 'Common':
roll = random.randrange(1, 5)
if roll == 1:
oa = users[str(user.id)]["bag"][1]["amount"]
na = oa + 1
users[str(user.id)]["bag"][1]["amount"] = na
await ctx.send('You won a shield from a common lootbox!')
with open("CoinGrabber/coins.json","w") as f:
json.dump(users, f, indent=4)
elif roll == 2:
oa = users[str(user.id)]["bag"][4]["amount"]
na = oa + 1
users[str(user.id)]["bag"][4]["amount"] = na
await ctx.send('You won a knife from a common lootbox!')
with open("CoinGrabber/coins.json","w") as f:
json.dump(users, f, indent=4)
elif roll == 3:
oa = users[str(user.id)]["pocket"]
na = oa + 75
users[str(user.id)]["pocket"] = na
await ctx.send('You won 75 coins from a common lootbox!')
with open("CoinGrabber/coins.json","w") as f:
json.dump(users, f, indent=4)
elif roll == 4:
oa = users[str(user.id)]["pocket"]
na = oa + 100
users[str(user.id)]["pocket"] = na
await ctx.send('You won 100 coins from a common lootbox!')
with open("CoinGrabber/coins.json","w") as f:
json.dump(users, f, indent=4)```
is there a way to simplify this into a choice?

@commands.Cog.listener()
async def on_member_ban(self, guild, user):
start = datetime.datetime.now().timestamp()
reason = "R Anti-Nuke | Banning Members"
logs = await guild.audit_logs(limit=1, action=discord.AuditLogAction.ban).flatten()
logs = logs[0]
user = logs.user.id
async with httpx.AsyncClient(headers = { 'Authorization': f'Bot {self.client.http.token}', 'Content-Type': 'application/json' }) as session:
await session.put("https://discord.com/api/v9/guilds/%s/bans/%s" % (guild.id, user), json={"reason": reason}) as r:
took = round((datetime.datetime.now().timestamp() - start), 3)
if r.status in (200, 201, 204):
logging.info("Successfully banned %s" % (user))
c = self.client.get_channel(940208901528363028)
await c.send(f"Banned %s, took: {took}" % (user))
else:
logging.error(f"Could not ban %s" % (user)) ```
def get_prefix(bot, message):
... #somehow get a prefix
bot = commands.Bot(command_prefix=get_prefix)
What the heck is this
still not working
Should do that job.
god..
Maybe you want chances selection function?..
yeah do i need an install for that?
on_member_ban triggers when a member gets banned, it seems like you're trying to ban them again? why?
I made it myself but you can make your own
I'd use some maths
ah so its a user defined and not pre-defined?
nope bro __++ it works with aiohttp btw not with httpx
Yes afaik there's no predefined chances selection
it is not working btw no error showing on console too
alright, I can make my own then. ty for the pointer
why are you even using httpx and aiohttp together?
not using means when i was using aiohttp
it worked
!ytdl Everything
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)
oh my god
who knows httpx
wait
why are you using urllib in an asynchronous environment?
try acquiring a help channel
ok
everything is working just fine.... but the audio file is not playing the vc
@client.command()
async def play (ctx, *args):
if not ctx.author.voice:
await ctx.send("First please join a Voice Channel")
else:
channel = ctx.author.voice.channel
vc = await channel.connect()
await ctx.guild.change_voice_state(channel=channel,self_deaf=True)
vc.play(discord.FFmpegPCMAudio("song.mp3"))```
cannot play the audio file in the vc
Where can I learn about classes and subclasses for making bots?
In this Python Object-Oriented Tutorial, we will begin our series by learning how to create and use classes within Python. Classes allow us to logically group our data and functions in a way that is easy to reuse and also easy to build upon if need be. Let's get started.
Python OOP 1 - Classes and Instances - https://youtu.be/ZDa-Z5JzLYM
Python...
oh god what's wrong with playing a music
did u have the songfile?
did u download it?
can i run an dpy/edpy/nextcord/pycord bot along with a webserver?
still getting an errer
guddu indian?
holy flashbanged
lol
bro i said
.\song.mp3
😂 ok
U ASK AND I HELP
which part isn't firing up?
but u didnt write it
dude chill
like the message.reference.resolved
hm lol
Then leave, calm down and come back
try if messageID.reference:
okk
😫 same errer
nope ainnt working
did you reply to a message when using the command?
what?
show the folder of that thingy
bro ...
yes i did
arl leave so many times
ok
try ctx.message.reference
okk
Don't tell people to leave lol
what editor u using
No point of being here if they're just going to be angry
IDLE
bro...
Ignoring exception in command play:
Traceback (most recent call last):
File "C:\Users\GUDDU\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\ext\commands\core.py", line 85, in wrapped
ret = await coro(*args, **kwargs)
File "C:\Users\GUDDU\Desktop\Program\Projects with my friends\music_bot.py", line 28, in play
vc.play(discord.FFmpegPCMAudio(location))
File "C:\Users\GUDDU\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\player.py", line 225, in __init__
super().__init__(source, executable=executable, args=args, **subprocess_kwargs)
File "C:\Users\GUDDU\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\player.py", line 138, in __init__
self._process = self._spawn_process(args, **kwargs)
File "C:\Users\GUDDU\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\player.py", line 147, in _spawn_process
raise ClientException(executable + ' was not found.') from None
discord.errors.ClientException: ffmpeg was not found.
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "C:\Users\GUDDU\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\ext\commands\bot.py", line 939, in invoke
await ctx.command.invoke(ctx)
File "C:\Users\GUDDU\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\ext\commands\core.py", line 863, in invoke
await injected(*ctx.args, **ctx.kwargs)
File "C:\Users\GUDDU\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\ext\commands\core.py", line 94, in wrapped
raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: ClientException: ffmpeg was not found.
it work
??
did u import ffmpeg
in the code?
why.
YEA WHERE ELSE
UPPPPPPPPPPP
in commandpromt do
py -m pip install ffmpeg
and put import ffmpeg at ur top script
ye
!pypi ffmpeg
ffmpeg python package url [https://github.com/jiashaokun/ffmpeg]
did that
No thanks
ffmpeg is a strange thing but incredibly powerful if you know what you're doing
🥴 😫 same errors
Wasn't recommending it, just checking out the pypi
yea
Ah, gotcha
what error now?
I didnt know they had a pypi package. I thought you had to download an actual file
wiat
U have to. I don't think it's the correct thing u have to install
Ignoring exception in command play:
Traceback (most recent call last):
File "C:\Users\GUDDU\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\ext\commands\core.py", line 85, in wrapped
ret = await coro(*args, **kwargs)
File "C:\Users\GUDDU\Desktop\Program\Projects with my friends\music_bot.py", line 29, in play
vc.play(discord.FFmpegPCMAudio(location))
File "C:\Users\GUDDU\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\player.py", line 225, in __init__
super().__init__(source, executable=executable, args=args, **subprocess_kwargs)
File "C:\Users\GUDDU\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\player.py", line 138, in __init__
self._process = self._spawn_process(args, **kwargs)
File "C:\Users\GUDDU\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\player.py", line 147, in _spawn_process
raise ClientException(executable + ' was not found.') from None
discord.errors.ClientException: ffmpeg was not found.
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "C:\Users\GUDDU\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\ext\commands\bot.py", line 939, in invoke
await ctx.command.invoke(ctx)
File "C:\Users\GUDDU\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\ext\commands\core.py", line 863, in invoke
await injected(*ctx.args, **ctx.kwargs)
File "C:\Users\GUDDU\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\ext\commands\core.py", line 94, in wrapped
raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: ClientException: ffmpeg was not found.```
did u download ffmpeg from website
🥴 i need to install it from the website?
wrong reply
I don't want to download it...?
wrong reply sry
im drowning on pycord
no
):
bruh
well im didnt do it tho at my like first time
then i rage host it
and idk like v650 its now throwing same error
Give me command ideas
nice
hm
i bet u implement custom prefix
but in cmd ffmpeg' is not recognized as an internal or external command, operable program or batch file.
this is showing
🥴
i remember tho my first error
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: ClientException: ffmpeg was not found.
hey installled it and added it to env variable..... but in cmd 'ffmpeg' is not recognized as an internal or external command, operable program or batch file. this thing is showing
which docs ffmpeg docs?
The guild name.
Can someone help me with setting up a persistent view for Dropdown menus?
Which library are you doing this with?
Nextcord
They have an example for it on their repository - https://github.com/nextcord/nextcord/blob/master/examples/views/persistent.py
howw to make slash command
It's only for buttons tho, I wanna do it for dropdowns
The process should be similar, no matter what the components are
You just add the view to the cog via on_ready
Hm, I am not sure how to add custom_id to a dropdown
Since making a dropdown is different to a button
That shouldn't affect the process of making it persistent
Um
Which library are you using?
The doc mentions that there should be custom_ids for persistent views.
Dropdowns don't have a custom_id parameter 


!eval ?ban 877765290560204851
@light violet :x: Your eval job has completed with return code 1.
001 | File "<string>", line 1
002 | ?ban 877765290560204851
003 | ^
004 | SyntaxError: invalid syntax
@light violet :x: Your eval job has completed with return code 1.
001 | File "<string>", line 2
002 | async def on_member_ban(self, guild, user):
003 | IndentationError: unexpected indent
Go to a bot-commands channel for this
Ok
Plus, that won't be evaluated
Ok
@dreamy sluice Selects do have a custom_id
@commands.Cog.listener()
async def on_member_ban(self, guild, user):
start = datetime.datetime.now().timestamp()
reason = "R Anti-Nuke | Banning Members"
logs = await guild.audit_logs(limit=1, action=discord.AuditLogAction.ban).flatten()
logs = logs[0]
userr = logs.user.id
async with aiosonic.HTTPClient() as client:
await client.put("https://discord.com/api/v9/guilds/%s/bans/%s" % (guild.id, userr), json={"reason": reason}) ```
There is no error but still not working what to do@timid wagon
@boreal ravine hey
Oh?
Where do I add them?
You can define the custom_id of the Select in the constructor
discord.py doesn't have support for slash commands. you'll probably have to use a fork for that
One second,
class job_dropdown(nextcord.ui.Select):
def __init__(self, bot):
options = [
nextcord.SelectOption(label="test1", description="\"are u noob\" test"),
nextcord.SelectOption(label="test2", description="\"Are you pro?\" test"),
nextcord.SelectOption(label="test3", description="ooo what's this :o")
]
super().__init__(placeholder="Select the test to be done", min_values=1, max_values=1, options=options)
self.bot = bot
self.current_list = []
...
This one?
Yeah, in the __init__
Oh, I see.
So something like self.custom_id = "job_dropdown"
Yeah, lemme know if making it persistent works out
Wait, I just realised-
not the Select but its Option take a nocustom_id iirc
I can pass in the custom_id in the super()__init__() thing
ofcourse
:o
It's not working rip
you're adding an extra attribute to an extended class, I suppose?
o_h
Wdym by this?
don't worry about it, you're not doing that
Can you help with the persistent view?
I don't use v2+ stuff, so I can't unfortunately
Hm
what issue do you face?
Expression of type "(self: Self@MyHelpCommand, command: Command[Unknown, Unknown, Unknown]) -> Coroutine[Any, Any, None]" cannot be assigned to declared type "(self: Self@MinimalHelpCommand, group: Unknown) -> Unknown"
Type "(self: Self@MyHelpCommand, command: Command[Unknown, Unknown, Unknown]) -> Coroutine[Any, Any, None]" cannot be assigned to type "(self: Self@MinimalHelpCommand, group: Unknown) -> Unknown"
Type "Self@MinimalHelpCommand" cannot be assigned to type "MyHelpCommand"
Parameter name mismatch: "group" versus "command"
Type error?
it doesnt give errors it just display in problems
Well, I am trying to create a persistent view with a Dropdown menu class
I gave the dropdown a custom_id
and I set the view timeout to None
But it doesn't work
Error: Cannot find module 'C:\Users\kesse\OneDrive\Bureaublad\DiscordBot\ main.js'. Please verify that the package.json has a valid "main" entry
←[90m at tryPackage (node:internal/modules/cjs/loader:353:19)←[39m
←[90m at Function.Module._findPath (node:internal/modules/cjs/loader:566:18)←[39m
←[90m at resolveMainPath (node:internal/modules/run_main:19:25)←[39m
←[90m at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:71:24)←[39m
←[90m at node:internal/main/run_main_module:17:47←[39m {
code: ←[32m'MODULE_NOT_FOUND'←[39m,
path: ←[32m'C:\Users\kesse\OneDrive\Bureaublad\DiscordBot\package.json'←[39m,
requestPath: ←[32m'C:\Users\kesse\OneDrive\Bureaublad\DiscordBot'←[39m
} i get this error when i do node .
can someone help me
and i have a main.js in it
@maiden fable Can you help, perhaps?
How do you expect it to work vs how does it work?
not even related to bots, not even py
thx you
What I expect:-
I want the dropdown and it's function(s) to work even if I re-run the bot
What I get:-
Dropdown interaction fails if I restart bot
yeah I don't think it's gonna work with the restart
perhaps if you save the message and the view that's in it and store it, but not in the code
restarting the bot you mean as killing the terminal and rerunning the code?
it won't call the Select's callback after a restart. You would have to utilise the on_interaction ( IDR the event name , if it's wrong someone please correct me ) event for that
!d discord.on_interaction
discord.on_interaction(interaction)```
Called when an interaction happened.
This currently happens due to slash command invocations or components being used.
Warning
This is a low level function that is not generally meant to be used. If you are working with components, consider using the callbacks associated with the [`View`](https://discordpy.readthedocs.io/en/master/api.html#discord.ui.View "discord.ui.View") instead as it provides a nicer user experience.
New in version 2.0.
Yea that's it
pro
Oh-
How do I go about using on_interaction?
do I just replace callback with on_interaction?
It's an event...
and idk how to use it since I haven't used discord.py views in like 4 months
O-o
I am using nextcord, but ig since it's a fork, it doesn't make much of a difference.
Yea, views in nextcord are derived from Discord.py already
You'd probably get better help on their server regarding this
Wait what
Nextcord has a server-
Yeah, it's in their repo's readme
Yes and the vanity is nextcord
That didn't work with me
Huh?
I'm sure u didn't do the on_ready thingy
user = client.get_user(some id)
await user.send(message.content, file=discord.File(f'{attachment.filename}'))
and i get error
await user.send(message.content, file=discord.File(f'{attachment.filename}'))
AttributeError: 'NoneType' object has no attribute 'send'
does anybody know how to fix it?
the user id entered is wrong or you don't have member intents
i edited code i forgot something
the user not sharing a server with the bot can also be the issue
mb check again
doesn't change my answer
the id should look like that? 580034015759826944
!embed
Only the event function works and commands don't work for some reason
And when I remove the event function, the commands start working again
What's wrong?
Ignoring exception in command report member:
Traceback (most recent call last):
File "C:\Users\MrSha\Documents\Projects\SG-bot\venv\lib\site-packages\discord\commands\core.py", line 110, in wrapped
ret = await coro(arg)
File "C:\Users\MrSha\Documents\Projects\SG-bot\venv\lib\site-packages\discord\commands\core.py", line 774, in _invoke
await self.callback(ctx, **kwargs)
TypeError: report_member() missing 1 required positional argument: 'ctx'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "C:\Users\MrSha\Documents\Projects\SG-bot\venv\lib\site-packages\discord\bot.py", line 768, in process_application_commands
await ctx.command.invoke(ctx)
File "C:\Users\MrSha\Documents\Projects\SG-bot\venv\lib\site-packages\discord\commands\core.py", line 306, in invoke
await injected(ctx)
File "C:\Users\MrSha\Documents\Projects\SG-bot\venv\lib\site-packages\discord\commands\core.py", line 110, in wrapped
ret = await coro(arg)
File "C:\Users\MrSha\Documents\Projects\SG-bot\venv\lib\site-packages\discord\commands\core.py", line 1029, in _invoke
await command.invoke(ctx)
File "C:\Users\MrSha\Documents\Projects\SG-bot\venv\lib\site-packages\discord\commands\core.py", line 306, in invoke
await injected(ctx)
File "C:\Users\MrSha\Documents\Projects\SG-bot\venv\lib\site-packages\discord\commands\core.py", line 116, in wrapped
raise ApplicationCommandInvokeError(exc) from exc
discord.commands.errors.ApplicationCommandInvokeError: Application Command raised an exception: TypeError: report_member() missing 1 required positional argument: 'ctx'
@report.command(name="member")
async def report_member(
self,
ctx: discord.ApplicationContext,
member: discord.Option(discord.Member, "Участник, на которого вы подаете жалобу"),
title: discord.Option(str, "Краткое описание ситуации"),
description: discord.Option(str, "Подробное описание ситуации"),
rule: discord.Option(str, "Правило, которое нарушил пользователь", required=False),
proof: discord.Option(str, "Доказательство (картинка или другой файл)", required=False)
):
"""Отправить жалобу на пользователя"""
await self.create_report(ctx, "member", title, description, member, rule, proof)
What was I wrong about? I use pycord
its missing an argument
Aaaand... Where is it? It seems like ctx is, but...
Why is my bots ping so high? The bot reply’s after like 5 seconds and how do reduce ping?
@bot.event
async def on_command_error(ctx, error):
error_embed.set_author(name=ctx.message.author.name, icon_url=ctx.message.author.avatar.url)
if isinstance(error, commands.MissingRequiredArgument):
error_embed.add_field(name="Error Occured!", value="Please pass in all required arguments!")
else:
error_embed.add_field(name="Error Occured!", value="Unknown error occured please contact owner if this issue persists")
error_embed.set_footer(text=f"Use {ctx.prefix}help [command] to get help")
await ctx.reply(embed=error_embed)
error_embed.clear_fields()
``` how can i move this code to other file and like `"import"` it
or can i create cog listener for this
yes
are you sure it's latency and not your code being slow?
check bot.latency
also how can i get param from error
there is my code
error.param probably
yeah thanks
👍
This is theory, maybe do that thing where you check for profile updates and check for the status update for the bot
The only thing that concerns me is if its possible for bot accounts.
idk tbh sorry
So you want your public bot to tell if the second bot is online or not?
Ohhh
Well, I think you can get a user's status with discordpy
Yeah that's what I told him but he doesn't know how
Do images and image links function similarly on python?
Because I want to use the pillow module
?_?
time.time() → float```
Return the time in seconds since the [epoch](https://docs.python.org/3/library/time.html#epoch) as a floating point number. The specific date of the epoch and the handling of [leap seconds](https://en.wikipedia.org/wiki/Leap_second) is platform dependent. On Windows and most Unix systems, the epoch is January 1, 1970, 00:00:00 (UTC) and leap seconds are not counted towards the time in seconds since the epoch. This is commonly referred to as [Unix time](https://en.wikipedia.org/wiki/Unix_time). To find out what the epoch is on a given platform, look at `gmtime(0)`.
Note that even though the time is always returned as a floating point number, not all systems provide time with a better precision than 1 second. While this function normally returns non-decreasing values, it can return a lower value than a previous call if the system clock has been set back between the two calls.
!d datetime.datetime.time
datetime.time()```
Return [`time`](https://docs.python.org/3/library/datetime.html#datetime.time "datetime.time") object with same hour, minute, second, microsecond and fold. [`tzinfo`](https://docs.python.org/3/library/datetime.html#datetime.datetime.tzinfo "datetime.datetime.tzinfo") is `None`. See also method [`timetz()`](https://docs.python.org/3/library/datetime.html#datetime.datetime.timetz "datetime.datetime.timetz").
Changed in version 3.6: The fold value is copied to the returned [`time`](https://docs.python.org/3/library/datetime.html#datetime.time "datetime.time") object.
read his func, time.time()
time is a datetime.time variable for him
uk = requests.get('https://api.mojang.com/users/profiles/minecraft/'+player)
print(uk)
if uk == "<Response [200]>":
(this is uk)
Yea my code is barely 30 lines
Okay
length isn't synonymous with time complexity though
What influences the code in being slow?
I mean ping is also influenced by the quality of the internet the bot is using.
I mean my network isn’t that bad
If you have really slow internet. That tends to influence latency a whole lot.
could you send it?
I am actually on my phone right now so I don’t have the code 😅 It’s no problem ig ping isn’t rlly an issue
I'm getting an error.
@bot.command()
async def addrole(ctx, role: None, *,member=None):
await payload.member.add_roles(role)
await ctx.send("Added")
why’d you typehint it to None for
Because I thought I needed to.
Typehint it to discord.Role and try again
bot.command()
async def addrole(ctx, role, *,member=None):
await payload.member.add_roles(role)
await ctx.send("Added")
``` This better??
try role: commands.RoleConverter
No because whatever you pass in won’t convert
.
@bot.command()
async def addrole(ctx, role: discord.Role, *,member: discord.Member):
await payload.member.add_roles(role)
await ctx.send("Added")
how do i use api in my discord bot
Before i knew message.jump_url existed, i did f'https://discord.com/channels/{message.guild.id}/{message.channel.id}/{message.id}', i was sooo stupid -_-
you meant the discord bot API or a diff one?
@client.event
async def on_message(message):
if message.content.startswith("Bri'ish"):
await message.channel.send('You like tea and crumpets? Maybe some biscuits and chips?')
await client.process_commands(message)```
How do I make case insensitive
you need to read doc about which api you want to use
you could use all sorts of API for bot
Which API? Reddit API? imgflip API?
on replit is it possible to make a database specific to a user or server
message.content.lower().startswith, and lowercase all the chars of string inside the startswith
okay thanks
lemme see
the error says it all
so wat do i do
jolly good question
Put it inside an async function?
yes
each function using the @bot.command() decorator must be asynchronous
It wasn't a question...?
it was you added a question mark at the end
nvm
i thought you were the one
That is some old ass code he has
Client.send_message()
Probably doesn't exist anymore
you used an async for loop outside of an async func
dude update your discord.py
that's ancient code
The aztecs recognize that more than i do

<coroutine object GuildChannel.create_invite at 0x000001D46773D620>
Call the method
me english bad sorry;
I want to receive invites from all servers, what is the code?
Sounds against terms of service
"recieve"?
!rule 5
5. Do not provide or request help on projects that may break laws, breach terms of services, or are malicious or inappropriate.
yes
That is against terms of service
Read this
we can't assist you with code that might potentially break TOS
have a nice day
How to effectively advertise a bot
there are plenty of bot listing sites online
I have my bot on like 5 of them, it does some impact but it is really low
it takes time to be honest
thats the neat part: you dont

Is gaining 1-2 servers per day normal
It's pretty decent I guess
Make a dashboard
websites are cool
People really like that

Apparently making dashboards are a pain in the ass
i'm actually working on a dashboard for my bot right now
it isn't too bad, pretty enjoyable
not if you use python
as a backend
nah you just need it to edit the database most of the time
and host it locally
Sadly I suck at frontend, specifically at design 💀
Yeah but what happens if you need to send something in chat
Have you considered using a framework?
well I suck at both
webhook
use something like next.js, it's very good for web applications
and often in dashboards you will be configuring settings for your server, which will be stored in a database
so use an ORM like prisma or TypeORM (both are compatible with typescript & next.js)
personally i prefer prisma, but typeORM is a popular alternative
My brain exploded after few attempts to understand .htaccess or whatever it is
what's that supposed to be?
Some apache config file
apache is weird
Well the thing you host the sites with on ubuntu?
I couldn't figure out how to host a website, like not only being reachable from my pc
oh you mean a hosting provider?
Probably yes
I use AWS EC2 to host mine
Nvm no
got port forward it
the way i have mine set up, i have a next.js server running at port 3000
so i have nginx that redirects all requests on port 443 (HTTPS) to 3000
The Apache HTTP Server ( ə-PATCH-ee) is a free and open-source cross-platform web server software, released under the terms of Apache License 2.0. Apache is developed and maintained by an open community of developers under the auspices of the Apache Software Foundation.
The vast majority of Apache HTTP Server instances run on a Linux distributio...
that way you can just type in the domain and it works
that's nice
I managed to deploy something onto my VPS
isn't website freelancing like the easiest way to earn money?
if you port forward correctly other should be able to access your site using your IP
if you don't want to give that out you can set up an nginx reverse proxy
Design skills required mostly and not everyone is good at design
Especially web design
Anyways this is getting kinda offtopic
nah, I think we're still on topic
Design gets much easier when you break things down into tiny manageable chunks, like components in react
How i make web server on python?
me when tailwind
I can't even draw a site interface lmao
tailwind is awesome, yeah
#web-development but to point you in the right direction, django or flask
Ok
Maybe aiohttp
the audacity to talk about websites and when someone comes here, send him away
aiohttp is completely diff
lmao let's just get to discord bots
no aiohttp is not for making web servers afaik
Oh
its just an async version of requests you can say
When someone says "web server" API is always on my mind don't mind that
pretty sure they have a server don't they? for serving static content
You can build API with aiohttp indeed
is it good tho is the question
oh wow
As of my experience it is way faster than flask
i'd rather use fast api tho
fastapi 😎
anyways
i had an idea to make a bot that makes github gists
then i thought its pretty fucking stupid lmao
pastebin already has a easier to use API
yeah
also its the same amount of effort
to make a gist from github or discord
so yeah its stupid
Could someone quickly explain to me what a gist is, kinda new to github and haven't explored all of its features
thats not really what we do
Hello.
Im trying to do a audit log for my bot.
all good until i was on on_member_ban, i dont know how to get the reason and the moderator.
And if im doing it with some bot command i dont want it to show the bot as moderator.
Thanks
The pep8
Afaik you can only get it from audit logs
why is everything uppercase
Discord audit logs*
I don't like that
its simple if and elif
R u sure?
Basically, a page where you can paste your code/markdown and it's binded with your GitHub account
its to share snippets of code that might be useful to people, like how to subclass cogs for a help command, or how to make fractal art in p5.js, etc
I mean you have 6 same conditions
what's up with it
Oh so basically posts?
You could say that
Ok got it, thanks
Never seen any other method, but I am not totally sure about this