#development
1 messages · Page 1659 of 1
when a user votes. its sending the same user multiple times
and they are getting dms
@final lynx you clearly are not reading what the user is saying
Please stop attempting to help others if you don’t know exactly what they are talking about
if your vote handler isnt responding correctly it's gonna resend them
Makes it harder for us to explain when someone is giving wrong information
How to do the vote count in dbd.js
is that even possible
Your gonna have to make manual requests
To do or to get?
Not possible
Either that or it isn’t even possible lmao
also, #topgg-api
So must l ask dbd.js support server
Still don’t know what he’s trying to do?
Just getting the total vote amount of his bot from top.gg?
Oh ok nvm
well, im sure it used to work as expected before. it starting happening since last night. so ig the rewrite was the reason
it kept triggering multiple times for the same user when others voted. which ended up in mass dms for the same user
hopefully it gets fixed by tomorrow
well that depends on who made the lib lul
the site working as should in that regard
Respond with 200 if you processed votes successfully and don't bother with rest
ezpz
What is the message
but its still not haplening.
And is there a error
happening.
No error, It sends the previous display name and the current display name.
would be helpful if you showed the code and error....
Sure
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.
@zenith terrace
ah, python...idk python
hmm
Because we don’t deal with snakes but @slender thistle
You can ping @slender thistle multiple times.
He likes if somebody is screaming his name
well so many things are a yikes in that code 
please tell me this bot isnt made for anymore than 1 server 👀
help me shivaco 

btw does it show the same as in here?
const fs = require('fs');
const ascii = require("ascii-table");
// Create a new Ascii table
let table = new ascii("Commands");
table.setHeading("Command", "Load status");
module.exports = (client) => {
// Read every commands subfolder
readdirSync("./commands/").forEach(file => {
// Filter so we only have .js command files
const commandFiles = fs.readdirSync('./commands').filter(file => file.endsWith('.js'));
// Loop over the commands, and add all of them to a collection
// If there's no name found, prevent it from returning an error,
// By using a cross in the table we made.
for (const file of commandFiles) {
const command = require(`../commands/${file}`);
client.commands.set(command.name, command);
}
// If there's an aliases key, read the aliases.
if (pull.aliases && Array.isArray(pull.aliases)) pull.aliases.forEach(alias => client.aliases.set(alias, pull.name));
});
// Log the table
console.log(table.toString());
}``` **if (pull.aliases && Array.isArray(pull.aliases)) pull.aliases.forEach(alias => client.aliases.set(alias, pull.name));** `ReferenceError: pull is not defined`

-
lo = log
why -
Do you plan on having your bot used in multiple servers? If yes, you need to use a dictionary, preferably as an attribute of your bot object.
-
For fun sake.
-
Yes. and how.?
Where do you define pull
Welp
i think he wants array.pull
If you are familiar with the general concept of OOP, you would be familiar with properties and methods. In this case, you have your bot object, so in order to actually have it shared between multiple files (if you need that), it's suggested you attach your dictionary as a property, e.g. bot.logs.
By default, that dictionary will not contain anything, and you will have to rely on using dict.get and settings/getting key values. In your case, it's preferred that you use the guild ID as they key and the channel ID as the value. On each on_member_update event emit, you get the ID from either of the sent member objects and use bot.logs.get(<guild_id>). If that returns None, don't send anything. Otherwise, generate the embed and send it
Gives me memories of how I had to rewrite this exact system in one of my bots to support multiple servers at once
ty 
Just disable slash commands in your channel.
You know, it does feel refreshing when people understand your walls of text
And they'll disappear.
i wana know how to add them in my bot
lol
js
I don't think they're supported there
Maybe see this?
is there any news about slash cmds
col
cool
il read it
There are but I'm not aware of any helpful resources about them
they give out a ton of slash command news
cool
Hi
hey, i need help
i want to do a dog command
the person who helped me do the bot send this to put into my dog.js file
const { get } = require("snekfetch");
module.exports = {
name: 'dog',
description: "dog command",
execute(message, args, Discord) {
try {
get('random.dog/woof.json').then(res => {
const embed = new Discord.MessageEmbed()
.setImage(res.body.file)
return message.channel.send({embed});
});
} catch(err) {
return message.channel.send(err.stack);
}
}
}
when i do *dog in my server
it gives me trouble
cause it doesnt work
random.dog/woof.json
he originally sent a cat command which worked and the link was https://aws.random.cat/meow
but the dog command does not
mention me when somebody can help
snekfetch is deprecated from what I know
what happens, do you get any errors? please describe your problem in a better way
Like that "Watching Discord Bot"
me too
they asked you what library you're using
why would you reply with: message
By changing the bots activities
Also known as presence
alright i’ll send it in dms when i’m done eating
send it here
I don't wanna take this into my dms
and I'm at school rn so I might not respond
@drifting socket
ok i’ll do it when i’m done eating
Well just use the search function in this channel and code snippets will magically appear

in discord.js:
client.user.setActivity('status here')
client.user.setActivity('status here', { type: "WATCHING" })
if (NewState.channel && NewState.member.user.tag === Bot.user.tag){
NewState.member.user.setDeaf(true)
}
``` Hi! I'm using voiceStateUpdate to deafen my bot when it joins a voice channel. Would this work?
just use connection.voice.setSelfDeaf(true) https://discord.js.org/#/docs/main/stable/class/VoiceState?scrollTo=setSelfDeaf
I use a dependency called DisTube. It doesn't include an option for me to set my bot to be Deaf automatically which is why I'm trying to do it a different way.
That's why I did NewState.channel.
no
Oh?
you'll get cannot read property channel of null
Oh.
@copper cradle
(node:1462) UnhandledPromiseRejectionWarning: Error: connect ECONNREFUSED 127.0.0.1:80
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1144:16)
(node:1462) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (rejection id: 1)
(node:1462) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
Thats the error it says when i say *dog
what database did you use?
ohh wait nvm its a api call
instead of sending the stack just send the message
you try to access an url that points to localhost port 80, what is your code?
it doesnt depend on the database, it depends on how you store it
my dude forgot to set the protocol in their url
add https:// at the beginning of the url
what is the URL you try to access
ok so when i do *dog
i want it to be a random photo of a dog
thats the thing
but it wont work
did you paste it like this into your call?
btw what lib did you use for calling the api?
idk what that means sorry i followed a tutorial so i dont know much about coding
here is the script
const { get } = require("snekfetch");
module.exports = {
name: 'dog',
description: "dog command",
execute(message, args, Discord) {
try {
get('https://random.dog/woof.json').then(res => {
const embed = new Discord.MessageEmbed()
.setImage(res.body.file)
return message.channel.send({embed});
});
} catch(err) {
return message.channel.send(err.stack);
}
}
}
snekfetch is deprecated, i suggest to use a supported libary, like exios
or node-fetch
can you send it back to me so i can paste it?
can anyone reccommend a good nodejs lib for parsing data out of excel or csv file?
remove the %27 from the URL it gives you an invalid URL, also the API can return mp4 files and i dont think you can embed it as a image
and you never close the string
but in the future i suggest to use this https://www.npmjs.com/package/axios over snekfetch
ok
Or node-fetch
also your handling of the return is wrong
the api returns a json that contains 2 keys
and you dont handle one of them
i dont really know what you mean, im new to starting this, this is like my first command that somebody helped me with.
yea sorry im like brand new to it
Well then read the docs of the libraries you use.
Somebody helping you doesn’t mean it will work tho.
did you figured out how to use axios?
nope
Oh nvm
is there a way to track how many messages a user has?
then i suggest to read the docs of it, if you dont understand the docs of axios, then i guess you dont know javascript well, then i suggest to learn a bit more javascript
Not afaik, only if you track them down, Zhyar
ok
use a time series database and grafana
a normal database can also work, just increment a key in it
then you can just use it in your code
I wouldn't exactly recommend axios. I consider it bloated as far as http libs go
where in discord.js(files)
Plus discord.js already comes with node-fetch
in ready event
might be thinking of some other http lib then
You’re probably speaking about the fetch lib not node-fetch
nah. Was most likely thinking of request
C:\Users\ravi_\Desktop\Discord Bots\Mail\structures\Client.js:36
client.user.setActivity('m!help - Draconic', { type: "Playing" });
^
ReferenceError: client is not defined
at ModmailClient.start (C:\Users\ravi_\Desktop\Discord Bots\Mail\structures\Client.js:36:9)
at Object.<anonymous> (C:\Users\ravi_\Desktop\Discord Bots\Mail\index.js:2:14)
at Module._compile (internal/modules/cjs/loader.js:1133:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1153:10)
at Module.load (internal/modules/cjs/loader.js:977:32)
at Function.Module._load (internal/modules/cjs/loader.js:877:14)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:74:12)
at internal/main/run_main_module.js:18:47
[nodemon] app crashed - waiting for file changes before starting...
``` I- Don't understand
How to get client defined
are you trying to use client in another file?
show the your code
kk
const{ MessageEmbed, Client, Collection } = require('discord.js');
class ModmailClient extends Client {
constructor(){
super();
/*
Dependencies
*/
this.path = require('path')
this.discord = require('discord.js')
this.fs = require('fs')
/*
Collections
*/
this.commands = new Collection();
this.threads = new Collection();
/*
Constants
*/
this.prefix = "m!";
}
commandHandler(path) {
this.fs.readdirSync(this.path.normalize(path)).map((f) => {
const File = require(this.path.join(__dirname, `..`, path, f))
this.commands.set(File.name, File);
});
}
getCommand(cmd) {
return this.commands.has(cmd) ? this.commands.get(cmd) : false;
}
start(token, path){
this.commandHandler(path);
this.login(token);
this.on('ready', () => {
console.log("I'm now online")
});
client.user.setActivity('m!help - Draconic', { type: "Playing" });
this.on('message', async(message) => {
if(message.author.bot || !message.guild || !message.content.toLowerCase().startsWith(this.prefix)) return;
const args = message.content.slice(this.prefix.length).trim().split(/ +/g);
const cmd = args.shift().toLowerCase();
const command = this.getCommand(cmd);
if(command) return command.run(this, message, args).catch(console.error);
})
};
embed(data, message) {
return new MessageEmbed(data).setFooter(message.author.tag, message.author.displayAvatarURL({ dynamic: true, format: "png" }));
}
}
module.exports = ModmailClient
here
use this instead of client
also, put it inside the ready event
kk
C:\Users\ravi_\Desktop\Discord Bots\Mail\structures\Client.js:36
this.user.setActivity('m!help - Draconic', { type: "Playing" });
^
TypeError: Cannot read property 'setActivity' of null
at ModmailClient.start (C:\Users\ravi_\Desktop\Discord Bots\Mail\structures\Client.js:36:19)
at Object.<anonymous> (C:\Users\ravi_\Desktop\Discord Bots\Mail\index.js:2:14)
at Module._compile (internal/modules/cjs/loader.js:1133:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1153:10)
at Module.load (internal/modules/cjs/loader.js:977:32)
at Function.Module._load (internal/modules/cjs/loader.js:877:14)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:74:12)
at internal/main/run_main_module.js:18:47
[nodemon] app crashed - waiting for file changes before starting...
``` What now
same code just changed client to this
did you put it in the ready event? because client.user isnt assigned until it's ready
Are you sure you wrote this code?

If you did you should definitely know where your ready event is
Hi, I'm trying to host my Bot on a Raspberry Pi.
The bot runs but it won't load the files from my cogs folder.
if filename.endswith(".py") and filename != "__init__.py":
bot.load_extension(f'cogs.{filename[:-3]}')
else:
print("Fail")
Does anybody know why?
Are there any cool bot commands I should develop?
!cool - show how cool you are. That some idea
you are 0/10 cool
they're using the this keyword but don't know where their ready event is
it's most likely they just copied it from somewhere, and somehow managed to make it work
does anyone know a good hosting platform
how long does it usually take for my bot to get approved or denied?
@cobalt island GalaxyGate
@jovial shoal read pins of support channel
Read pins in this channel
ok thank you i was about to sit here for 3 hours but nvm
thank you though
I need some help please. I've made my own bot and used the app "bot commander". I need to "host" the bot 24/7 on my phone which drains my battery FAST. is there anyway to keep the bot online so the functions work without going from the app?
And please @reply me
code it yourself
yes, use an actual programming lang
dont use apps
I suck at programming 💃
learn...
Everyone does until they do it
If you aren't willing to learn then just... don't make a bot and use already existing ones
Never said i wasn't willing to learn.
Even now where I could work in a professional environment most likely, I still suck at programming
Since there aren’t already enough tho...
Alrighty thanks for the input
does try{} catch(){} catch promise rejections?
That's what try catch blocks are for
ok
only if you await them
yes I do
await functions na?
@blissful viper #memes-and-media
did i hear cringe
yes
-b 627415529824714752 yeet
Banned █▬█ █ ▀█▀ me はdaddyは#8181 (@blissful viper)
btw is it SEND_MESSAGE or SEND_MESSAGES ?
perm
plural
God thanks god developed a search and replace (all) feature
use regular expression option?
You can also use the built-in enums discord.js provides instead of hard-coding the permission names
I read the reason... I am happy I didn't turn on my headphones
const {Permissions} = require("discord.js");
Permissions.FLAGS.SEND_MESSAGES;
I won't spend another hour for that
Open all files, search and replace all, 10s maybe less 
Right now, I use this:
r.users.remove(message.author.id);
To remove the reaction the user pressed after they clicked it. However, is there a way to make the bot remove all the reactions from a specific emote?
For example, if they click 1️⃣, I want it to remove that 1️⃣ reaction entirely.
some canvas problem
what the fuck do u even need help with
yes
Tam ab
what's so funny
how to solve this
install build tools
how ?
okok
Hello does anyone know the method to remove all reactions from a specific emote?
delete message and recreate
smart guy above
Well I'd prefer to do it more efficiently
oml
import discord
from discord.ext import commands
import json
import os
import random
os.chdir("C:\Users\ravi_\Desktop\Discord Bots\Mail")
client = commands.Bot(command_prefix = m!)
@client.event
async def on_ready():
print("Ready")
@client.command()
async def balance(ctx):
await open_account(ctx.author)
users = await get_bank_data()
wallet_amt = users[str(user.id)]["wallet"]
bank_amt = users[str(user.id)]["bank"]
em = discord.Embed(title = f"{ctx.author.name}'s balance", color = discord.Color.red())
em.add_field(name = "Wallet balance",value = wallet_amt)
em.add_field(name = "Bank balance",value = bank_amt)
await ctx.send(embed = em)
@client.command()
async def beg(ctx):
await open_account(ctx.author)
users = await get_bank_data()
user = ctx.author
earnings = random.randrange(101)
await ctx.send(f"Some gave you {earning} coins!!")
users[str(user.id)]["wallet"] += earnings
with open("bank.json","w") as f:
json.dump(users,f)
async def open_account(user):
user = await get_bank_data()
if str(user.id) in users:
return False
else:
users[str(user.id)] = {}
users[str(user.id)]["wallet"] = 10
user[str(user.id)]["bank"] = 0
with open("bank.json","w") as f:
json.dump(users,f)
return True
async def get_bank_dat():
with open("bank.json", "r") as f:
user = json.load(f)
return users
client.run("Discord Token-Secret")
``` Did I do something wrong with the code?
its discord.py (python) It isn't working
that no wasn't for u
Usually in my reaction collector I have
r.users.remove(message.author.id)
But this time I want to remove everything not only the message.author

how the fuck am I supposed to guess
what happens when you run it
does it error
no
nothing at all
what function are you trying to run
an Economy Bot..
that's not what I asked my dude
read again
which of the functio... "commands" you have there did you run
and what happened when you did
how am I supposed to guess that
"my bot doesn't work"
pastes all 30 thousand lines of code
that's #development for you
give your best and try to imagine
that's why i avoid this channel 
its usually stinky djs devs that don't understand basic principles of the language they chose
and then they expect every developer to guess what the fuck they were trying to do
Reminds me of the good old
"What language is your bot in?"
"English"
I literally asked
"what function are you trying to run"
and the reply I got
"an economy bot"

lol
Oh great ```
Python was not found; run without arguments to install from the Microsoft Store, or disable this shortcut from Settings > Manage App Execution Aliases.
<Reactions>.removeAll()
install python ig
I have python ..
Does it remove all reactions, I only want it to remove all reactions for one single emoji
ig from github?
add python to the path
how?
idk man
system environment variables
ohh ok
This ig
assuming you use windows
ok, math time:
consider the folowing values
0, 1, 2, 3, 4, 5
how would I get the wrapped distance between 0 and 5?
nice guess
I'm trying to figure that for about 1 hour by now
like
distance between 0 and 5 should be the same as 0 and 1
like a circle
hm, maybe using sin?
What do you mean by wrapped distance
this
idk how to explain, like
I right click the pc and get this. I need propeties not graphic propeties
instead of being linear it'd wrap around
right click on "my computer" icon
if windows 10 just click the cog icon on start menu and search "computer"
if lastValue = 5 then lastValue = 0
I mean, I prefer to avoid ifs when possible
there has to be a mathematical way
I'm actually thinking about converting the values to radians then using sine
That just got meh to this
I said cog icon -> search computer
not start menu -> search computer
Why are you avoiding if statements?
idk where that is
It's going to make the code more readable
open settings screen and press the frist icon
oh wait
react native
a component that refreshes very often
also
it'd give me the wrong distance between 0 and 4 too
since it'd return 4
instead of 2
first icon you mean system?
yes
kk
THAT'S windows 10 computer properties
if you want old computer properties just search computer on the start menu and click properties
where is advanced settings
just use the old-style properties menu smh
idk, you didn't say what you want to do
whose???
>>> l = [0,1,2,3,4,5]
>>> x1 = l[2]
>>> x2 = l[-1]
>>> x1
2
>>> x2
5
>>> dx = abs(x1 - x2)
>>> if dx > len(l) / 2:
... dx = len(l) - dx
...
>>> dx
3
Got it
already figured out lul
used sine for that
fucking hell
The complete path of python.exe can be added by:
Right-clicking This PC and going to Properties.
Clicking on the Advanced system settings in the menu on the left.
Clicking on the Environment Variables button on the bottom right.
In the System variables section, selecting the Path variable and clicking on Edit. The next screen will show all the directories that are currently a part of the PATH variable.
Clicking on New and entering Python’s install directory.
Where is System Variables
Oh dear
Literally open the search bar and type in "Env"
yep
Can be found also browsing the "old" control panel or by clicking on the Windows icon > System
ALSO
You can just use the modulo operator for your problem
n % 6
yup
. .
/
I entered Python’s install directory now what?
But you have to make sure that val can't ever be bigger than (min + max + 1)
Now try using python in your command prompt
Also it's just max + 1 actually
Python was not found; run without arguments to install from the Microsoft Store, or disable this shortcut from Settings > Manage App Execution Aliases
although I'll stick with sine solution because it outputs a normalized value
fits better for my usage
but thx
np
does somebody now a good landing page creator or any html css ui kit?
Python was not found; run without arguments to install from the Microsoft Store, or disable this shortcut from Settings > Manage App Execution Aliases.
What now??
add it to path
did that
here
oh wait is it C:\Program Files\python\
@earnest phoenix
Did you expect just typing in Python's install directory to work??
no but thats what it said here https://www.educative.io/edpresso/how-to-add-python-to-path-variable-in-windows
bruh
By that they mean to provide the actual install directory
not to write "Python's install directory" literally
that's sad
actual install directory
To be more correct the path of the app bin
which one has the install directory
whats the length for a server ID
The one which contains the actuall binary (.EXE)
However it's been called
probably python.exe
That's the install path

18 chars
thanks
Maybe for python, not all app bins are located in the root path
By install directory they mean the directory you provided to the python installer
hmm I didn't look at the provided link
BTW I'm 99% sure there's a option to add python to path in the installer
nobody?
So what directory did you enter in PATH?
That looks like the Windows app store
maybe ;-;
I Just enter Python install diretory
and my computer froze for 10mins
Take a look at the other entries and you may see the issue
of course because it's not a valid path to a directory
man
Just reinstall it, this time enabling the "Add python to path" option
function replacevar(content , vars){
console.log(content)
content.replace("{membercount}", vars.membercount)
content.replace("{username}", vars.username)
content.replace("{usertag}", vars.usertag)
content.replace("{usermention}", vars.usermantion)
content.replace("{userid}", vars.userid)
return content;
}
there is a better way to do that
though it, thats sad lol
yes?
just content += content.replace(...
const msg = <String>.replace(/{(.+?)}/g, (match: string) => {
switch (match.slice(1, -1)) {
case 'x': return 'y'
default: return match
}
})```
wait
fixed
I use {{shit}}
not {shit}
and great thing about that is you don't have to deal with doing /X/g regex
Is there a discord.js function to find messages by message id?
it only sends the default prefix
any ideas why
if(msg.author.bot) return;
var prefix = config.prefix;
db.get(`SELECT * FROM servers WHERE id='${msg.guild.id}'`, (e, row) => {
if(row !== undefined) return prefix = row.prefix;
});```
i replaced prefix = row.prefix with console.log(row.prefix) and it shows the server's custom prefix
why would you select all if you just need the prefix?
btw. if(row) ... will work as well
yeah
Is that quick.db?
Oof I’m not that experienced with sqlite 3 sorry

That's because you change the prefix in the callback
ok
the callback executes after the command executes
^
anyone here ever scripted with powershell?
thanks
You need to put your entire code in the callback, or promisify the function
maybe it already returns a promise idk
or just use better-sqlite3
do what?
you can, just not like that
You probably can but you have to await it
ok ill try
hii
hello
someone can help me about verify my bot
i don't know how answer the questions of in verification request 😢
my EN is bad
just i created bot for gaming
@agile lance send the inv link to me in dms about this discord developer server
nop
update: im using better-sqlite3 instead of sqlite3 and its going well
that is my problem my EN ois bad
thanks
np
Then answer in your language and message the support about it. We can't help you.
oh that is bad just i know i created this bot for gameing
ty so much
I don't understand why the dbl vote endpoint would be called over and over spam dming the same user

i will try to fix it
Other bots seem to be working fine
gl
oops.. wrong word in my answer, changed it
i know that sometime get me error cuz my words is wrong
anyway... just answer the questions in your main language
i do it ❤️ ty
require.resolve is not a function
for (const file of fs.readdirSync('./eventos/')) {
if (file.endsWith(".js")) {
let fileName = file.substring(0, file.length - 3)
let fileContent = require(`./eventos/${file}`)
client.on(fileName, fileContent.bind(null, client))
delete require.cache[require.resolve(`./eventos/${file}`)]
}
}
ye
they dont support it
?
repl.it uses node in esm mode, which doesnt support require.cache nor require.resolve, among other things
Anyone know the difference between JSONP and JSON? I'm looking on the express docs, and can't really understand res.jsonp() and what it does.
the info is a quick google search away
JSONP stands for JSON with Padding.
Requesting a file from another domain can cause problems, due to cross-domain policy.
Requesting an external script from another domain does not have this problem.
JSONP uses this advantage, and request files using the script tag instead of the XMLHttpRequest object.
JSONP, or JSON-P (JSON with Padding), is a historical JavaScript technique for requesting data by loading a <script> element, which is an element intended to load ordinary JavaScript. It was proposed by Bob Ippolito in 2005. JSONP enables sharing of data bypassing same-origin policy, which disallows running JavaScript code to read media DOM elem...
is it possible to ban a use from a guild that is not member from the guild anymore ? By example someone that left, so <guild>.members.cache doesn't includes him anymore, but client.users.cache does ? (using djs)
please ping me*
im trying to get the category the message channel is in and message.channel.parent is null?
guild.members.ban can accept a string which can be the ID of the user you want to ban
```if(!msg.channel.parent.name) return msg.channel.send(${config.x} Not a ticket channel!);
lol what
im reading my code
lol my brain is so dead
just nvm
oh yeah just saw that, ty 👍
you should check if (!msg.channel.parent) instead of trying to access something potentially null

do you get the bot dev badge anymore
or did they remove it
and if they did remove it, y
They didn't remove it, but you cannot get it anymore
only users who verified within the first 1-2 weeks got it
a lot of people posted fake applications just to get the badge, discord had enough of it and said no
...
"Will you sell your verified dev account for 1 bitcoin"
Hell yeah
do u think they'll bring it back
1 bitcoin? holy shit
3 accounts sent me that. It was the same person
I mean if it was real I'm down for it, just saying
people literally trying to buy bot dev or early supporter accounts
I'd be down as well. Bitcoin prices have gone up insane
still sad i sold mine at 30k
30k is pretty good tho
“Would you sell your verified bot for $200?”
Come on now, that ain't enough
How much would you sell it for
Damn
yeah so 57k
lol
lmao... someone ask you that
Yep
i make a lot more than that in premium each month
But idk after you said this
you sold your bot for $30k? or at 30k servers?
yeah for real, i make about £400 a month in premium at 80k servers
his bitcoin
ah
triviabot
maybe, i keep going places where people have used it
Sec*
i spent a bit on ads that i have to pay myself back
Ahhh, yeah idk if I should implement premium features to my bot
ASAP?
even at say 200 servers youll have at least one superfan who'd pay
yeah, what kind of bot is your bot
It’s a coconut maller with image generation, soundboard, moderation and misc commands
coconut maller?
Yeah
is that like a cookie clicker/idle miner?
No haha
If you look up “You just got coconut malled” you would see what I mean
It’s quite similar to Rick bot with different features
Me neither
I was just bored and started developing it
my bots website has a tribute to memes in its easter egg
@crimson vapor wtf
competitor
go to my bots site and do: up up down down left right left right b a b a
I’m on phone
I’ll be on pc soon
i'll have to make a gesture version
That’s a cheat code to activate premium?
lol
yup!
Have you played gta on a PsP before?
go to https://triviabot.co.uk and use keyboard: up up down down left right left right b a b a
Add trivia quiz games to your discord server with this free to use bot from Brainbox.cc. Featuring over 100,000 questions, nitro prizes, team play, leaderboards, quickfire rounds, community rewards, a user friendly dashboard, there is nothing quite like this bot. Invite now!
embed it
would there be a harm in allowing access from anywhere w mongo DB
lol
im in vr kekw
there, embedded it
ty
lol what a laziness
5, 4, 3..

I hate you
guess its not possible in vr
TIL people will do anything for a freebie
always
lmao
yk I will just vibe to the rickroll idc at this point 
Rick Astley has good songs actually
he was such a one hit wonder
Umm welp, so i get memes from reddit and post them on discord. I am just wondering if i can filter the memes by the number of upvotes.
when using video.src = "" (html and js) there's a black flash every time i do it
how would you remove the black flash
posters seem to
fill way more than it should be able to
let vid = document.getElementById("screen");
// I don't know if this would remove the video from cache.
vid.pause();
vid.removeAttribute('src');
vid.src = "../pathways/" + scenename + "/video.mp4";
vid.play();
current code
@green kestrel https://triviabot.co.uk/js/unittest.js pog code
you like it?
I got a minified one with tamper protection too unittest.min.js @crimson vapor
feel free to reuse it elsewhere
lol
My mini high performance static server running wew
hopefully this will fix my cdn issues
Hey guys.
If anyone could help me with discord.py - i would appreciate it.
I am trying to work with the streamlabs API connected to a discord bot.
When something specific is entered into the channel.
(For example:
@client.event
async def on_message(message):
if "hello" in message.content:
# DO STUFF
```)
But how do I do this for a SPECIFIC channel.
Because i do not want all channels to be checked, just 1 specifically.
if message.channel.id == channel id here:
await ctx.send("stuff")
yup
E
wait, does it work if i do async def on_message(ctx, message) ?
@earnest phoenix Because "ctx" isn't defined if I do it.
await message.channel.send
my bad
Hey guys
heyoo
in d.js how to get the number of channels the bot is connected to?
is it client.voice.broadcasts
or client.voice.connections
quick quetion
question*
does anyone know how to make a multi guild reaction roles?
make a list of guilds and role ids for each guild
when a user reacts, check if the user exists in said guilds, and for each guild they exist in, add them the role id for that guild
yes but I want to make it automatic
with a database
not implementing servers manually
same thing
My code is this: js { name: "Current Status: ", value: status, inline: false },, but I get this:
what is status
@quaint wasp
like if you are online or offline..
}
const status = {
online: "YOUR EMOJI",
idle: "YOUR EMOJI",
dnd: "YOUR EMOJI",
offline: "YOUR EMOJI"
}
.addField("** Status**", `${status[member.user.presence.status]}`,true)
and Im guissing you put that before the status thing?
const Discord = require('discord.js');
const moment = require('moment')
module.exports.run = async (bot, message, args) => {
const flags = {
DISCORD_EMPLOYEE: ``,
DISCORD_PARTNER: ``,
BUGHUNTER_LEVEL_1: `Bug Hunter (Level 1)`,
BUGHUNTER_LEVEL_2: `Bug Hunter (Level 2)`,
HYPESQUAD_EVENTS: ``,
HOUSE_BRAVERY: `:BraveryLogoemoji:`,
HOUSE_BRILLIANCE: ``,
HOUSE_BALANCE: ``,
EARLY_SUPPORTER: ``,
TEAM_USER: `Membre team`,
SYSTEM: `Système`,
VERIFIED_BOT: `Bot certifié`,
VERIFIED_DEVELOPER: `Développeur bot certifié`,
}
const status = {
online: "",
idle: "",
dnd: "",
offline: ""
}
@quaint wasp you did value: status
meaning status is a variable
what is the content of this variable
how did you define status
I didnt....
you did
@quaint wasp use a variable
then where did you get status from
Discord.js labrary
use notpad otherwise
i mean in your code
or atom
where did the variable status come from
Why isn't my code working?
Nothing seems to be printed in the debug logs or the channel
@commands.Cog.listener()
async def on_dbl_vote(self, data):
print('Vote recieved!')
print(data)
gg_channel = self.client.get_channel(819639514758643754)
await gg_channel.send(f'data = {str(data)}')
await gg_channel.send(f'Vote from {data.user} found!\nThank you for voting! You have recieved a gift of 10 rating points.')
That indentation seems wrong
My code ```js
import discord
from discord.ext import commands
import json
import os
import random
os.chdir("C:\Users\ravi_\Desktop\Discord Bots\Mail")
client = commands.Bot(command_prefix = m!)
@client.event
async def on_ready():
print("Ready")
@client.command()
async def balance(ctx):
await open_account(ctx.author)
users = await get_bank_data()
wallet_amt = users[str(user.id)]["wallet"]
bank_amt = users[str(user.id)]["bank"]
em = discord.Embed(title = f"{ctx.author.name}'s balance", color = discord.Color.red())
em.add_field(name = "Wallet balance",value = wallet_amt)
em.add_field(name = "Bank balance",value = bank_amt)
await ctx.send(embed = em)
@client.command()
async def beg(ctx):
await open_account(ctx.author)
users = await get_bank_data()
user = ctx.author
earnings = random.randrange(101)
await ctx.send(f"Some gave you {earning} coins!!")
users[str(user.id)]["wallet"] += earnings
with open("bank.json","w") as f:
json.dump(users,f)
async def open_account(user):
user = await get_bank_data()
if str(user.id) in users:
return False
else:
users[str(user.id)] = {}
users[str(user.id)]["wallet"] = 10
user[str(user.id)]["bank"] = 0
with open("bank.json","w") as f:
json.dump(users,f)
return True
async def get_bank_dat():
with open("bank.json", "r") as f:
user = json.load(f)
return users
client.run("Bot Token")
My error
PS C:\Users\ravi_\Desktop\Discord Bots\EconomyManager> python main.py
File "C:\Users\ravi_\Desktop\Discord Bots\EconomyManager\main.py", line 7
os.chdir("C:\Users\ravi_\Desktop\Discord Bots\Mail")
^
SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 2-3: truncated \UXXXXXXXX escape
So ``` client.on('voiceStateUpdate', (oldState, newState) => {
if(newState.channelID !== null) {
const voiceChannelName = newState.channel.name
let roleFind = newState.guild.roles.cache.find(role => role.name === voiceChannelName);
var roleName = roleFind;
if(roleFind) {
newState.member.roles.add(roleName)
}
}
if(oldState.channelID !== null) {
console.log(roleName)
oldState.member.roles.remove(roleName)
}
})``` whenever the `if(oldState.channelID !== null)` goes off, the variable `roleName` is now undefined. why?
Use double backslashes or os.path.sep
You can't use single backslashes as it thinks you're trying to do an escape character

^^not the face before that
Huh?
Your string in os.chdir has backslashes in it, that won't work
You need to escape it with another backslash
kk
Or use os.path.sep as that will automatically pick the separator char for your operating system
File "C:\Users\ravi_\Desktop\Discord Bots\EconomyManager\main.py", line 9
client = commands.Bot(command_prefix = m!)
^
SyntaxError: invalid syntax ``` I changed it to \\\ so now what
well m! is not valid syntax
That takes a string or a character
I would recommend that you learn basic python, or if you already know some, read the error messages. They can be useful
m! isnt correct syntax
It needs to be a string
can someone help me make my bot play mp3s into vc?
like custom mp3s that i add in, not from youtube
with discord.js, you can just do Connection.play(pathToMP3)
what library are you using
yeah idk py
would probably want to use FFmpeg with something like this https://stackoverflow.com/questions/63036753/discord-py-bot-how-to-play-audio-from-local-files
Basically the title. I installed ffmpeg and discord.py[audio] already. I just need to learn how it works. couldn't find any tutorial for local audio files. and I cant understand anything from
Anyone here use WSL?
ya
wyd @swift umbra
what kinda stuff 😉?
you should stream in General then
you sure?
cringe
and ive posted in the wrong channel
Yo
what is the startup command for .py
python
idk python but I really thought it was python file_name.py
hmm, ill give it a shot, brb
its python file.py @hazy horizon
ok so do python main_file_name.py
and import the 2nd file in the main file
and sorry this may offend you: Learn python before making a discord bot
like just make sure to learn how to run python code
@indigo ice
public static void main(String[] command_line_args) throws FileNotFoundException, java.io.IOException {
Person me = new Person("SomeGuy",28);
ObjectOutputStream out = new ObjectOutputStream(new FileOutputStream("Data.tx"));
out.writeObject(me);
}
trying to store objects into a txt file but it doesn't work
dont store into text files, its single threaded and prone to corruption
ohh ok
what do you recommand
what do u think is best?
Json?
a database
json aint a db
true but Im using intelij and I don't want to pay for sql
both offer free cloud databases
mysql, pgsql, they are free
also mysql is a lot more mature libs than mongo on java
mongo only excels at support on js
r u using italian?
its possible that your command handler splits the messages apart
so you just send !Attentato
ugh I have to relearn sql
ye that helps
sql is not this hard, the basic stuff will help you already
yea it is just counter productive that I forgot how to use it
google is your friend
u are lower casing the message.content
and this startswith contain uppercase A
wut
so it wont be called
hmm okay
and this one?
can i ask what the problem in the first place
change this
that "Attentato...."
it should be all lower case
so "attentato...."
dahek
hi
can anyone tell me purge command? i want to add that command in my bot. Pls anyone tell.
ok!
👀
message.guild.members.forEach(m => m.rickroll())
ok fr this time
purge command
message.guild.members.forEach((m) => {
m.kick()
})```
this purges
all members
noo. i want purge command which deletes the messages!
ohhh
message.guild.members.forEach((m) => {
m.ban()
})```
this purges
and deletes users messages
i think this is the part everyone laughs
@sand seal use message.channel.bulkDelete
ok. can u send me the whole coding of purge?
ohhh
the whole coding of purge
this purges
you're welcome
yaa. pls
thankx
it is not working
I wonder why 
Hi
how can i get my api token from the website?
https://top.gg/bot/<your bot id>/webhooks
THX
Or go to the edit page and click the "Webhooks" tab
that works thx
hi can someone help me with plasma bot?
Go to their support server
their link is expired
discord.gg/W8x4dWS this?
ty
can anyone help me?
File "c:\Users\schwt\OneDrive\Desktop\bot with db\main.py", line 5, in <module>
array = numpy.random.randint(0, 100(10, 5))
TypeError: 'int' object is not callable```
error
100(10, 5) numbers cannot be called because they're not functions
you're missing a comma
where?
look closely
const Discord = require('discord.js');
module.exports.run = async (bot, message) => {
if (!message.guild) return
let args = message.content.trim().split(/ +/g)
if (args[0].toLowerCase() === "v!clear") {
if(!message.guild.me.hasPermission('MANAGE_MESSAGES')) return message.channel.send(' | **Oupss il me faut la permission `MANAGE_MESSAGE`**').then(msg => msg.delete({ timeout: 5000}))
var embedclear = new Discord.MessageEmbed()
message.delete()
if (!message.member.hasPermission('MANAGE_MESSAGES')) return message.channel.send(" | **Vous devez avoir la permission `MANAGE_MESSAGE` pour faire cela**").then(msg => msg.delete({ timeout: 8000}))
let count = parseInt(args[1])
if (!count) return message.channel.send(" | **j'ai besoin de s'avoir le nombre de message à supprimés**").then(msg => msg.delete({ timeout: 8000}))
if (isNaN(count)) return message.channel.send(" | **Veuillez indiquer un nombre valide**").then(msg => msg.delete({ timeout: 8000}))
if (count < 1 || count > 50) return message.channel.send(" | **Veuillez indiquer un nombre entre 1 et 50**").then(msg => msg.delete({ timeout: 8000}))
message.channel.bulkDelete(count + 1, true)
message.channel.send(` | **${args[1]}** message(s) was delete`).then(msg => msg.delete({ timeout: 10000}))
}
}
module.exports.help = {
name: "clear"
}
uh, what's wrong?
@sand seal
yes
for clear
Thankx
just translate fr in en
ok
How do i put my bot to send animated emojis? Do i need nitro on my account?
Ok thanks
Ok thanks again
and must have "use external emojis" permission
How do I make a voting reward on discord.py from top.gg?
https://dblpy.readthedocs.io/en/latest/
By using the dbl api, here are the docs for it
Use #topgg-api for any further questions about it
How do i see the id of an animated emoji
right click it
and select copy link and get the id if you don't have developer mode on
Pokemon zeraora?
I got developer mode activated and doens't show to copy the ID
No
No
that's weird
What are the options when you right click it then?
just add a \
Ok
the client still filters it out
ctrl shift i
Ok I posted in the wrong one.
I'm currently having issues with the bot timing out.
It's easier to help if you show the code that is failing
Alright, where will I find this?
In.. your code?
If you're getting an error message it should tell you what line it errored at
It's currently erroring at the host. Ie. The bot. I'll show you the error message.
Thats what we want

Huh? What are you trying to access?
hi, can someone help me code a restart bot command?
i really dont know where to start
I'm updating or submitting my server to the bot.
Bot?
What is "the bot"?
The DSL bot.
?
The a should be something or its really a
it's really an a. Short for animated
Ok, but i think this is not correct const m = await message.channel.send("a:3339_loading:802499427200663612 **Aguarde...**");
your assumption is true, it's not in the format provided by flazepe
i cant put the <>
Why can't you put em?
It show me this
it shows you this when you use < and >?
Oh, i think i found the problem

