#development
1 messages · Page 977 of 1
There is no users mentions, only roles/channels/members
Oof oki
@spark breach u should recheck the spelling... first()
Yeah i noticed xD
oof so there is a users.mention?
I- yeah xd
lol and no wonder why we are still answering then xd
at Client.emit (events.js:315:20)
at Object.module.exports [as GUILD_MEMBER_ADD] ```
I get this error
can someone help?
2020-06-17T13:03:44.537349+00:00 app[worker.1]: at Client.<anonymous> (/app/bot.js:33:45)
2020-06-17T13:03:44.537350+00:00 app[worker.1]: at Client.emit (events.js:315:20)
2020-06-17T13:03:44.537351+00:00 app[worker.1]: at Object.module.exports [as GUILD_MEMBER_ADD] (/app/node_modules/discord.js/src/client/websocket/handlers/GUILD_MEMBER_ADD.js:16:14)
2020-06-17T13:03:44.537351+00:00 app[worker.1]: at WebSocketManager.handlePacket (/app/node_modules/discord.js/src/client/websocket/WebSocketManager.js:386:31)
2020-06-17T13:03:44.537352+00:00 app[worker.1]: at WebSocketShard.onPacket (/app/node_modules/discord.js/src/client/websocket/WebSocketShard.js:444:22)
2020-06-17T13:03:44.537352+00:00 app[worker.1]: at WebSocketShard.onMessage (/app/node_modules/discord.js/src/client/websocket/WebSocketShard.js:301:10)
2020-06-17T13:03:44.537353+00:00 app[worker.1]: at WebSocket.onMessage (/app/node_modules/ws/lib/event-target.js:125:16)
2020-06-17T13:03:44.537353+00:00 app[worker.1]: at WebSocket.emit (events.js:315:20)
scroll up
ah fric
unless it's cut off since it's heroku logs
then you need to wait for it to happen again
with logs on
because i don't think there's a way to get past errors in heroku
unless it's cut off since it's heroku logs
can you confirm this?
yes
yeah, wait with the logs page
its probably cut off
because i don't think there's a way to get past errors in heroku
Don't think you can't if you've refreshed the page
yeah no
Nope you can't after you've refreshed it
but you can look in /app/bot.js:33:45
true
look for syntax errors or an unhandled promise
Lo
looks at installed PyCharm and a few discord.py bots
Nah
Just ask your question tbh
yes i can help maybe
looks at installed PyCharm and a few discord.py bots
Nah
@slender thistle looks at bots asking for donation while using cracked/trial version of PyCharm
they need donations so they can buy it :^)
ngl PyCharm is a fuckfest when formatting f-strings
Can You Say Whats Worng? Becouse I Don't Know😫
have you tried reading the error
yep
Reading the error solves 75% of problems
Oh
index.js is not found
why am i being limited to one song in only one server for ffmpeg
async def play(ctx, url: str):
song_there = os.path.isfile("song.mp3")
try:
if song_there:
os.remove("song.mp3")
except PermissionError:
await ctx.send("Wait for the current playing music end or use the 'stop' command")
return
await ctx.send("Getting everything ready, playing audio soon")
print("Someone wants to play music let me get that ready for them...")
voice = get(client.voice_clients, guild=ctx.guild)
ydl_opts = {
'format': 'bestaudio/best',
'postprocessors': [{
'key': 'FFmpegExtractAudio',
'preferredcodec': 'mp3',
'preferredquality': '192',
}],
}
with youtube_dl.YoutubeDL(ydl_opts) as ydl:
ydl.download([url])
for file in os.listdir("./"):
if file.endswith(".mp3"):
os.rename(file, 'song.mp3')
voice.play(discord.FFmpegPCMAudio("song.mp3"))
voice.volume = 100
voice.is_playing()```
looks at bots asking for donation while using cracked/trial version of PyCharm
@lyric mountain theres also an actual free version of pycharm
there isn't
pycharm community edition
Ok
When I am writing a code of
@client.event Async def on_member_join(member) the things I wrote was only for the console window so if I use the same thing to show in the discord server so will it show a message whenever a person joins.
This is a little silly question but I need answers.
ah, they released a CE version of it
they did
Yes or no
it used to be professional-only
Ok ik
caps matters haha
? anyhelp ?
Could you please elaborate on your issue, though? @lofty fern
it should work the same way yes
That event will be fired whenever someone joins a server, yes
removes messages older than the time provided
Is it in miliseconds?
for example, sweepMessages(60) would sweep messages older 60 seconds ago and keep messages received more recently than 60 seconds ago
no, its in seconds
removes messages older than the time provided
@quartz kindle so what can this be used for
For clearing channels
If number is unspecified, it clears all the messages on the channel, based on what I read
that would not be good
it doesnt affect discord
cache = copies of discord content stored locally
discord.js is always storing discord data in case you need it
Like restoring messages?
exactly
@summer torrent you can use it for manual cache sweeping, if you have any reason for that, for example if you want to disable automatic sweeping
Thanks again for the help!
I almost put that .sweepMessages in my code to literally clear a channel hahaXD
Alert ("this is a alert box lol")
Ok boomer.
Haha buumaajanai
maybe
Yes
hi, with git, is there anyway i can remove all the red lines bc i deleted something and its hard to see if i still need to commit anything
like i do git status and it shows
theres loads more
here is my code rnpy roleee = await ctx.guild.create_role(name=name) print(roleee)(for context, name is defined) And when I print roleee, it comes up with the role name, how do I get the ID of the role?
Does anyone here know sololearn
@slender thistle
Is it for websites
k lemme try
Is sololearn for websites
read
Not jut websites
sololearn is good
what do you call these js <Message id=721901924139401227 channel=<DMChannel id=700383825967972352 recipient=<User id=247741991310327810 name='shivaco' discriminator='9999' bot=False>> type=<MessageType.default: 0> author=<ClientUser id=676448082556354583 name='Guardian' discriminator='5385' bot=True verified=True mfa_enabled=True> flags=<MessageFlags value=0>>
it worked ty
That's a message object
an object?
hey guys im using python for discord bots and I wanna include r6s stats in my bot. When i install this python lib (https://github.com/billy-yoyo/RainbowSixSiege-Python-API/blob/master/README.md) I get an error (ERROR: discord-py 1.3.3 has requirement aiohttp<3.7.0,>=3.6.0, but you'll have aiohttp 2.3.10 which is incompatible.) would this effect me at all?
does it have a specific name for it? i searched python objects and they don't seem to be the one
most likely would if dependencies are conflicting @earnest phoenix
representational string ig
thanks
https://www.programiz.com/python-programming/methods/built-in/repr that's what this website says
The repr() function returns a printable representation of the given object. In this tutorial, we will learn about Python repr() in detail with the help of examples.
You could probably scrap the source code and modify it for yourself
im still learning python im not sure i could do that
I thought it's outdated haha
Bruh discord guide is to much
Tbh
i have a question how can a make a variable that keep the content iven if the bot restart ?
thx
what database would i use if i would like to do large scale?
personally i'd recommend using postgres
postgres is used in the gaming industry
a lot of triple a titles use it for their servers
ive had issues with postgres
did you just start developing?
c+++ isnt even a thing
if so js is probably easier
if you mean cpp, don't use a language where you have to do manual memory management lol
because you're inexperienced
cpp/c++ is a very low level language, which requires understanding of computers to understand
c++++#
Oh
javascript is a high level language that does most low level complicated stuff for you automatically
lmao
this is #development
13
O_O

so, anyways, i want to make a bot, that sends some text, to an endpoint, but spaces ruin everything
i need to fix my space problem
@timber linden Mind actually stopping shitposting in #development and not using emotes that contain racial slurs
yes it is
just encode the spaces
Oof
im bot invite plss
%20 is the url encoding of the space character
@spiral jackal this is dbl, wait for approval
what do you call +?
like i have been doing for 17 days now
sometimes spaces are replaced by +
it's also a space character but for a different content type iirc
i don't remember which
someone can teach me how to code create role command ?? i only know how to code give role and take role command.
which library are you using
discord.js
lmao
when i do git status it shows
what the fuck
how can i amke it not show that bc its hard to keep track of what i need to commit
i did
i forgot to add it, i pushed everything and w/ node modules by accident
then added node modules to it
you need to commit again without node modules
just do git commit -m 'removed node modules or something?
Yes
Try git rm
just do git rm ?
kk
gg
Or if that doesn't work
what do i do now?
i need who have a meme api
git commit -am "mycommit"
Hello?
?
https://discordpy.readthedocs.io/en/latest/
Does this work for you guys
or is it just me
it works for me
fuck
It used to not work for me
or any rtfd.io link then tbh
It fixed itself at some some point
yes
guys for java, better vscode or eclipse ?
ok we agree ^^
vsc is not an IDE though and can't be compared
how to change the color with hex ??
i mean how i to change the color like this !createrole #ffffff newrole
a r g s
You need args bruh
** a r g s**
lmao
perhaps
try it and see
And let's see the error

Yea basically args will do the trick
please learn basic js
hey
module.exports = {
name: 'bj',
description: "runs a game of blackjack",
execute: (message, args) => {
const K = 10;
const Q = 10;
const J = 10;
let aa = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, J, Q, K];
let bb = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, J, Q, K];
let a = Math.floor(Math.random() * aa.length);
let b = Math.floor(Math.random() * bb.length);
message.channel.send("`" + message.author.username + " has " + aa[a] + " points`\n`Bot has " + bb[b] + " points`");
if (aa[a] > bb[b]){
message.channel.send(`${message.author.username} wins!`)
}
else if (bb[b] > aa[a]){
message.channel.send(`Bot wins!`)
}
else{
message.channel.send("\nThe match is a tie!")
}
}
}
this is my code
im beginning to make a blackjack command
but when the command is executed
and if someone gets a king for example
it just says 10 and not k
is there a way to change this
Well you defined K = 10
you need to define conditions for that
wdym
or map display names and values separately
for example ```js
const cards = [
{
name:"1",
value:"1"
},
{
name:"2",
value:"2"
},
...
]
so then you can have name:"Q", value: 10
or if you want to make it simpler, you can use a multidimensional array, like this cards = [[1,1],[2,2],...,["Q",10]]
isnt in "" right
yeah if you're gonna use math on it, better without quotes
yeah kk
thnx
ok so i used a multidimensional array
but how do i
make it only display the string
soz im kinda dumb lol
any raw basic code of play command?
(for music bots)
@earnest phoenix https://google.com/search?q=music+bot+github+discord
dont copy paste
i know
theyre not sirectly working
i know x2
or simply make from scratch
you need to edit the code a bit, to make it work
3 years old..
i made my bot in html!
what
@digital ibex cool
thank u
it basically is
ok nice
using ejs probably?
no its not l0l
i didn't
hes trolling lol
no lol
yeah in only html, but if you use embed js or angular js, then it is
you can code a browser js websocket and conect to discord
v12 is latest :D
@restive furnace well i can convert to v11
or convert my bot structure to v12
.-
i think second
one
theres wrappers made for making music bot's what makes it lot of easier, think using them rather than searching public music bot's source codes and copy pasting it and editing a bit.
can someone tell me
how i can
display one value of each sub array in a multidimensional array
what language u using?
one of each?
like display a list of all values?
or display the value of a specific item in the list?
yea like one of each
you can map the array
for example [[a,1],[b,2],[c,3]].map(item => item[1]) = [1,2,3]
ok thx
a lot
idk if this will work
but
can i make a variable equal to [[a,1],[b,2],[c,3]]
and do
var.map(item => item[1]) = [1, 2, 3]
soz im kinda new to js
yes
thats what map does
but it does not alter the original variable, you need to assign the result to a new variable
ok
thnxx
im very sorry
for asking so many times
but
module.exports = {
name: 'bj',
description: "runs a game of blackjack",
execute: (message, args) => {
let aa = [
['1', 1],
['2', 2],
['3', 3],
['4', 4],
['5', 5],
['6', 6],
['7', 7],
['8', 8],
['9', 9],
['10', 10],
['J', 10],
['Q', 10],
['K', 10]
];
let bb = [
['1', 1],
['2', 2],
['3', 3],
['4', 4],
['5', 5],
['6', 6],
['7', 7],
['8', 8],
['9', 9],
['10', 10],
['J', 10],
['Q', 10],
['K', 10]
];
let aaa = aa.map(item => item[1]) = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 10, 10, 10]
let bbb = bb.map(item => item[1]) = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 10, 10, 10]
let a = Math.floor(Math.random() * aa.length);
let b = Math.floor(Math.random() * bb.length);
message.channel.send("`" + message.author.username + " has " + aaa[a] + " points`\n`Bot has " + bbb[b] + " points`");
if (aaa[a] > bbb[b]){
message.channel.send(`${message.author.username} wins!`)
}
else if (bbb[b] > aaa[a]){
message.channel.send(`Bot wins!`)
}
else{
message.channel.send("\nThe match is a tie!")
}
}
}
this is my code
uh
and it says this error
ReferenceError: Invalid left-hand side in assignment
ive never used arrays like this before
bruh i sound so dumb rn
Tim meant js const foo = [[a,1],[b,2],[c,3]].map(item => item[1]) // foo is [1,2,3]
dudes
module.exports = {
name: 'bj',
description: "runs a game of blackjack",
execute: (message, args) => {
let aa = [
['1', 1],
['2', 2],
['3', 3],
['4', 4],
['5', 5],
['6', 6],
['7', 7],
['8', 8],
['9', 9],
['10', 10],
['J', 10],
['Q', 10],
['K', 10]
];
let bb = [
['1', 1],
['2', 2],
['3', 3],
['4', 4],
['5', 5],
['6', 6],
['7', 7],
['8', 8],
['9', 9],
['10', 10],
['J', 10],
['Q', 10],
['K', 10]
];
let aaa = aa.map(item => item["1"])
let bbb = bb.map(item => item["1"])
let a = Math.floor(Math.random() * aa.length);
let b = Math.floor(Math.random() * bb.length);
message.channel.send("`" + message.author.username + " has " + aaa[a] + " points`\n`Bot has " + bbb[b] + " points`");
if (aaa[a] > bbb[b]){
message.channel.send(`${message.author.username} wins!`)
}
else if (bbb[b] > aaa[a]){
message.channel.send(`Bot wins!`)
}
else{
message.channel.send("\nThe match is a tie!")
}
}
}
got a trouble
this still doesnt work
name: "spawn arceus",
category: "N/A",
description: "spawning pokemon: arceus",
run: async(bot, message, args) => {
const Embed = new MessageEmbed()
.setTitle(`A Wild Pokemon appeared type `.catch <pokemon name>` to catch it!`)
.setColor(`RED`)
.setFooter(``)
.setDescription('Pocket Monster!')
create embed const exampleEmbed = new Discord.MessageEmbed()
Set your image .setImage('https://cdn.bulbagarden.net/upload/thumb/f/fc/493Arceus.png/1200px-493Arceus.png')
Send the embed message.channel.send(exampleEmbed);
message.channel.send(Embed)
}
}```
remove the quotes
what fault
[1]
are you telling me?
name: "spawn arceus",
category: "N/A",
description: "spawning pokemon: arceus",
run: async(bot, message, args) => {
const Embed = new MessageEmbed()
.setTitle(`A Wild Pokemon appeared type `.catch <pokemon name>` to catch it!`)
.setColor(`RED`)
.setFooter(``)
.setDescription('Pocket Monster!')
create embed const exampleEmbed = new Discord.MessageEmbed()
Set your image .setImage('https://cdn.bulbagarden.net/upload/thumb/f/fc/493Arceus.png/1200px-493Arceus.png')
Send the embed message.channel.send(exampleEmbed);
message.channel.send(Embed)
}
}```
fault please
someone hwlp
maybe?
oh
did you see the bottom tho
he copy-pasted
very epic
that's probably some code taken from examples
my frnd did
name: "spawn arceus",
category: "N/A",
description: "spawning pokemon: arceus",
run: async(bot, message, args) => {
const Embed = new MessageEmbed()
.setTitle(`A Wild Pokemon appeared type `.catch <pokemon name>` to catch it!`)
.setColor(`RED`)
.setFooter(``)
.setDescription('Pocket Monster!')
create embed const exampleEmbed = new Discord.MessageEmbed()
Set your image .setImage('https://cdn.bulbagarden.net/upload/thumb/f/fc/493Arceus.png/1200px-493Arceus.png')
Send the embed message.channel.send(exampleEmbed);
message.channel.send(Embed)
}
}```
@mossy vine I'm looking for a bot developer that can make bots using C#
@acoustic kiln no, you should read the example and learn how to code
Is that where I can find people who do that stuff?
some kind of freelancer hiring site
so should i change red
@acoustic kiln you need to read the code actually
@pale vessel my friend did
there are 2 uncommented-comments there
he said t ask
HE said to ask?
is it correct
I have bad news then
your friend is oficially lost
@pale vessel Another other site you can recommend?
why
he copied that code from somewhere if he doesn't know the issue
ooo
@coarse apex search for sites where you can hire bot developers
@pale vessel Yeah, I have no idea where, so that's why I asked you if you had any other sites in mind. I would appreciate it
@coarse apex https://www.freelancer.com/
okok
idk if someone would be willing to work on a C# bot project for free tho
No one said for free
so freelancer.com is your go-to
@acoustic kiln note that you WILL need a database for storing pkmns and user data
so I'd suggest trying something easier before
@coarse apex just post a request there
someone will answer
Alright, thanks.
@lyric mountain i have
he copy pasted lol
embed.add_field(name=f"Roles ({len(roles)}):", value=" ".join([role.mention for role in roles]))
it sends 2 @ infront of everyone
why?
Because default role's name is @everyone literally
but it sends it like @@everyone
slice(1)
Yup
is it normal?
should i change it to name instead of mention?
use a for loop with a check if role.name == "@everyone":
i need help how to make a private DM for discord.js v12.2.0
@north hollow User/Member#send(content) literally.
where do i put that am new to discord.js
use a
forloop with a checkif role.name == "@everyone":
@slender thistle what do u mean?
note to that
you can also check for the id
the @everyone role id is going to be equivalent to the guild id
@everyone id is same as server id
also for loop is basically basic javascript.
yeah
Except we're using Python
which is where the <@&264445053596991498> magic comes in
are two @ bad?
Eh, it looks unusual but it doesn't cause anyone harm
oh yea im blind
... other than people with OCD, I guess?
if its not bad or idk im gonna let it like this
It's not "bad"
it doesn't do anything
it's quite literally just a mention of the @everyone role
and it doesn't send out a ping, the actual @everyone string in a message does
ok then, thanks for the help
i need help how to make a private DM for discord.js v12.2.0
@north hollow
User/Member#send(content)literally.
@freestyle#0001
I'm actually curious what will be more efficient:
- a for-loop with an
ifto get only the everyone role's name - store role mention list in a variable and then .append/.appendleft to it

any idea why i cannnot install node-superfetch? (v12) : npm i node-superfetch
npm WARN tar ENOENT: no such file or directory, lstat 'C:\Users\Lavi\Desktop\Swag-Bot-master\node_modules\.staging\mathjs-31a849e1\src\function'
npm WARN tar ENOENT: no such file or directory, lstat 'C:\Users\Lavi\Desktop\Swag-Bot-master\node_modules\.staging\googleapis-f67d078b\build\src\apis'
npm WARN tar ENOENT: no such file or directory, lstat 'C:\Users\Lavi\Desktop\Swag-Bot-master\node_modules\.staging\googleapis-f67d078b\build'
npm WARN tar ENOENT: no such file or directory, lstat 'C:\Users\Lavi\Desktop\Swag-Bot-master\node_modules\.staging\googleapis-f67d078b\build\src\apis\vault'
npm WARN swag-bot@2.2.7 No repository field.
npm ERR! code ENOENT
npm ERR! syscall spawn git
npm ERR! path git
npm ERR! errno ENOENT
npm ERR! enoent Error while executing:
npm ERR! enoent undefined ls-remote -h -t git://github.com/gwicke/web-streams-polyfill.git
npm ERR! enoent
npm ERR! enoent
npm ERR! enoent spawn git ENOENT
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent```
@restive furnace
@restive furnace where do i put that
anyone here used datadog?
how do i remove a reaction as soon as someone reacts to it
not the whole reaction
just the one reaction from the user
i have a problem with embeds: UnhandledPromiseRejectionWarning: TypeError: fields.flat is not a function. Pleas help me
Show what you put?
@radiant estuary update node
how can i do this?
Where are you hosting?
how do you mmake a command keep going in py
like it keeps restarting after completing the task until i stop it
Where are you hosting?
@earnest phoenix glitch...
@radiant estuary do you have $3.50 a month?
yes
use lightsail
i know this is not expensive
Lol you have to do
"node": "12.x"
}``` in your `package.json`
ok thx
Add that somewhere in your package.json but place it correctly
how do i remove a reaction as soon as someone reacts to it
not the whole reaction
just the one reaction from the user
now it should work
okay thx
Anyone know how I would sort a mysql query, then add the output to an embed?
anyone here used datadog? my problem is I am incrementing value but it didn't show up on dashboard
@earnest phoenix ORDER BY? https://www.tutorialspoint.com/mysql/mysql-sorting-results.htm
MySQL - Sorting Results - We have seen the SQL SELECT command to fetch data from a MySQL table. When you select rows, the MySQL server is free to return them in any order, unless you ins
hi, am I doing something wrong here?
async function showTeachers() {
try {
const stuff = await database();
const stuff2 = await con.connect(function(err) {
con.query("SELECT * FROM TheTeachers", function (err, result, fields) {
con.end()
console.log('It begins here')
console.log(result)
console.log('And it ends here')
return result
})
})
return process(stuff);
} catch (err) {
console.error(err);
}
}
not so good with async functions
"process is not a function"
is the result
learn js and what undefined represents
undefined can mean this variable doesn't have an equals sign but it is not the only meaning
aight imma head out
what is up with people acting dumb
how u learning it?
lol, he's cleaning his comments
lmao
well, what else should I do lol? I have asked a question and I guess people dont bother with it?
I will figure it out by reading some stuff about async functions..all good
deleting the comments would make cry's comments context-less
which is kinda a dick move
but anyway
xD np, anyway, it doesnt matter, I have found an other way to make it. I used async, but then I have changed it to old .then syntax and it worked
xD big bang boom exatcly check mate
Hello,
To catch a specific error in python how can I do ?
ExtensionAlreadyLoaded: Extension 'adab' is already loaded.
I'm doing it by typing :
if type(Exception).__name__ == "ExtensionAlreadyLoaded":
pass
But I know there is another method because I'm using in my code this line from the API docs :
if isinstance(error, commands.errors.MissingPermissions):
pass
is it possible to make a discord bot online almost all the time with a raspberry pi?
Do this work?
try
something
except exceptions.ExtensionAlreadyLoaded:
pass
try it and see
you are right
lmfao
@dapper compass isinstance(error, commands.ExtensionAlreadyLoaded) iirc
import asyncio
import r6sapi as api
async def run():
auth = api.Auth("email", "password")
player = await auth.get_player("billy_yoyo", api.Platforms.UPLAY)
operator = await player.get_operator("sledge")
print(operator.kills)
await auth.close()
asyncio.get_event_loop().run_until_complete(run())
``` I found the docs for a python r6 api thing and i wanna make this into a bot command but im not sure how i would integrate it can someone help?
wym?
what r u talking about
like math commands
eval command?
const Discord = require("discord.js");
module.exports = {
name: "uptime",
category: "info",
description: "Shows the bots uptime.",
run: async (client, message, args) => {
function duration(ms) {
const sec = Math.floor((ms / 1000) % 60).toString()
const min = Math.floor((ms / (1000 * 60)) % 60).toString()
const hrs = Math.floor((ms / (1000 * 60 * 60)) % 60).toString()
const days = Math.floor((ms / (1000 * 60 * 60 * 24)) % 60).toString()
return `${days.padStart(1, '0')} days, ${hrs.padStart(2, '0')} hours, ${min.padStart(2, '0')} minutes, ${sec.padStart(2, '0')} seconds, `
}
message.channel.send(`I have been online for: ${duration(client.uptime)}`)
}
}
Why doesn't the days work?
why toString() tho
btw, days wouldn't be % 60
but % 31 or % 30
and hours would be % 24
i mean it will give him a int so to a string
but he's putting that int in a string, which will automatically convert to string
or a float
yh idk
ik what u mean
i see it
but u can do it that way but u will need to do some string concatenation
const Discord = require("discord.js");
module.exports = {
name: "uptime",
category: "info",
description: "Shows the bots uptime.",
run: async (client, message, args) => {
function duration(ms) {
const sec = Math.floor((ms / 1000) % 60)
const min = Math.floor((ms / (1000 * 60)) % 60)
const hrs = Math.floor((ms / (1000 * 60 * 60)) % 24)
const days = Math.floor((ms / (1000 * 60 * 60 * 24)) % 30)
return `${days.padStart(1, '0')} days, ${hrs.padStart(2, '0')} hours, ${min.padStart(2, '0')} minutes, ${sec.padStart(2, '0')} seconds, `
}
message.channel.send(`I have been online for: ${duration(client.uptime)}`)
}
}```
format is like concatting, but it's easier to read
would that work
use moment btw
lol much easier using moment
import asyncio
import r6sapi as api
async def run():
auth = api.Auth("email", "password")
player = await auth.get_player("billy_yoyo", api.Platforms.UPLAY)
operator = await player.get_operator("sledge")
print(operator.kills)
await auth.close()
asyncio.get_event_loop().run_until_complete(run())
```I found the docs for a python r6 api thing and i wanna make this into a bot command but im not sure how i would integrate it can someone help?
how do i turn a promise into a string?
what
I got this ```js
let math = argument.toString().replace('x','').replace('÷','/').replace('×','').replace('--','+')
var add = new Promise((resolve, reject) => {
resolve(math)
})```
why are you making it a promise
use reduce like i told u, theres no need to do that
I'm making a levelling feature with my bot and I did some research and Sequelize version 4 is a security threat, Does anyone know how I would use version 5? would I just add version: '5' to my dbInit file?
but that's another problem i guees
idk how to use regex
@still merlin in order to update major versions, you need to uninstall it and reinstall it
I dont have it installed rn I need to install it now (Doing reserch)
the current version on npm is 5.21.13 but if you have version 4.x.x installed, it wont let you update to 5.x.x because major versions usually contain breaking changes that would break your code if updated
em.add_field(name="**Status**", value=user.status)
Is there a possible way if they online i could put green emoji and idle = orange and so on...
How do you install Sequelize? ;-; whenever I try to install it this happens
caps
dont have the caps
npm i sequelize
h!
yes
make a dir FFmpeg and inside folder avconv
and download this
@low orbit
it should work
yes
Download FFmpeg builds for Windows or macOS, available as LGPL or GPL.
go down
and press download build
ye
please i want game for my bot (discord.py) Give my idea
make a high end AAA title
in discord
Thank ^^ another idea
?
how can i host a bot for free?
i used discordjs & Discord Bot Maker to make the bot
you have the file ?
todict = {
"online": "🟢",
"dnd": "🔴",
"idle": "🟡"
}
em.add_field(name="**Status**", value=todict[user.status])
can someone help and tell me why this isnt showing any error and not working.
Because user.status isn't a string
yes @vagrant cedar
It returns discord.Status.x where x is the status
yes i have, but if it does not work for free, is it possible to run the bot on a webserver @earnest phoenix
aka discord.Status.online, discord.Status.idle, etc.
MMMMMmmmhhhh.... No my have pc for run bot go to dm @vagrant cedar
huh
im bot verified pls <@&304313580025544704>
-atmods
Please do not mention (ping) more than one or two moderators for help, unless there is an emergency.
Here are some examples of emergencies:
- Raids / Multiple members mass spamming.
- Severe disruption of Discord's ToS (NSFW content, etc)
- Anything that requires more than 2 moderators to handle.
-faq 2
ah sorry
lol
-upto
The FAQ clearly states that it will take UP TO 1 week or more.
This does not mean it will take a week and does not mean it will take less than a week.
There is no set time for how long bot approval will take.
There is a queue and you're not first, nor are you last.
It will be reviewed once it's your bot's turn in the queue
er, can someone help '-'
PS C:\Users\Jon\Desktop\SpiderBot Project> node .
C:\Users\Jon\Desktop\SpiderBot Project\node_modules\sequelize\lib\dialects\abstract\connection-manager.js:88
throw new Error(`Please install ${moduleName} package manually`);
^
Error: Please install sqlite3 package manually
at ConnectionManager._loadDialectModule (C:\Users\Jon\Desktop\SpiderBot Project\node_modules\sequelize\lib\dialects\abstract\connection-manager.js:88:15)
at new ConnectionManager (C:\Users\Jon\Desktop\SpiderBot Project\node_modules\sequelize\lib\dialects\sqlite\connection-manager.js:22:21)
at new SqliteDialect (C:\Users\Jon\Desktop\SpiderBot Project\node_modules\sequelize\lib\dialects\sqlite\index.js:14:30)
at new Sequelize (C:\Users\Jon\Desktop\SpiderBot Project\node_modules\sequelize\lib\sequelize.js:324:20)
at Object.<anonymous> (C:\Users\Jon\Desktop\SpiderBot Project\dbObjects.js:3:19)
at Module._compile (internal/modules/cjs/loader.js:1128:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1167:10)
at Module.load (internal/modules/cjs/loader.js:983:32)
at Function.Module._load (internal/modules/cjs/loader.js:891:14)
at Module.require (internal/modules/cjs/loader.js:1023:19)
at require (internal/modules/cjs/helpers.js:72:18)
at Object.<anonymous> (C:\Users\Jon\Desktop\SpiderBot Project\index.js:15:33)
at Module._compile (internal/modules/cjs/loader.js:1128:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1167:10)
at Module.load (internal/modules/cjs/loader.js:983:32)
at Function.Module._load (internal/modules/cjs/loader.js:891:14)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12)
at internal/main/run_main_module.js:17:47
PS C:\Users\Jon\Desktop\SpiderBot Project> ```
"Error: Please install sqlite3 package manually"
I saw that. how do I do that thought
you need to manually install sqlite3
I cant find the website ;-;
@limber flume use this:
const status = {
"dnd": "YOUR EMOJI",
"online": "YOUR EMOJI",
"idle": "YOUR EMOJI",
"offline": "YOUR EMOJI"
}
and
${status[user.presence.status]}```
this should work
why
they're using d.py
Literally the only reason I started mumbling about discord.Status
ex for last part:
embed.addField("User", `${status[user.presence.status]} ${user.username}#${user.discriminator} (\`\`${user.id}\`\`)`)```
@slender thistle i wrote for sean wich use discord.js
Many cases of people literally just C+P here so I wouldn't rely on it too much...
@still merlin i literally googled the erorr and the first result shows u what to do
..
Does anyone here know an easy way to leave my computer to train on a set of images?
I tried hyperGAN but couldn't get it to work
Anyone know a quick one to set up?
Can someone help me made a purge command ?
How to get traceback from a task? (Python:
)
@calm linden theres tons of youtube tutorials for that topic m8
Hello good support I want to ask if I can make a level system but with a command called e.profile and that says the experience but without any message
I don't have the code yet, I just wanted to know if I could
Yes, it’s possible, you can create anything.
says the experience without any message
how else is the user supposed to read your content
Can I make a word counter?
why not
If you want to.
What's up?
trying to get my bot to join VC and play music
whenever i tell it to join it says im not in a voice channel
even though i am
hold on letme get the code
how can i get the users badges? all i've got is a number. how can check what it is
libraries supports that
wym?
you need have your bot in 100 servers
the library gives a number
eris
it returns a number, like mesage.author.publicFlags
wait a sec
https://nmw03.is-inside.me/1WzX9SSe.png
Discord.js has a toArray() function.
hm
ok
this is my play command
whenever i am in a VC and i call it to join it wont join because according to the bot i am not in a VC
do i have to change message.member to message.author
i'm pretty sure
k ima try it
@solid mesa If you mean to send the experience profile without executing the message it can be done, by having it as a timed message or by using a database and executing it somewhere else like from a dashboard.
Im pretty stuck on something. I requested some values from an api, and it returned a really long string filled with random values.
I did some searching and its a a base64 gzip encoded string.
Is there an easy way to decompress and decode it? or a package?
im currently writing a package so I dont really want to add another depenency
javascript
nope it dont work
it wont detect me when i am in a voice channel
it says i need to join a voice channel even though i was in one as of typing the command
@urban olive what library version are you using?
discord.js
What version, 11 or 12?
@empty owl b64 is easily encodable and decodable
where do i check?
Check your package.json
If it’s the latest then 12
@regal briar using plain javascript or a package?
not sure im a python guy sry
ah
it says 12.2
thanks fo rhte help tho
Try ‘message.member.voice.channel’
take a look at that @empty owl
thanks
instead of what?
Instead of voiceChannel
Send a screenshot
I meant to replace only voiceChannel with voice.channel
Yeah, that’s good
it doesnt play the song tho
That has to do with your other code
the error message says connection.playStream is not a function
is there a solution?
@urban olive try only play instead of playStream
will they find solution?
ok
or just glitch is dead
wait
Probably but it will take time
And glitch is pretty much slowly dying with the amount of problems they're having
Lmao
😦
now to make the bot only play the dk rap
thank you for information misly!
does anyone know how to decompress a gzip in javascript
Tbh its to be expected as its free
its better if its pure javascript so I dont have to add a depencency
And they're getting over loaded
or aws
aws is free
i think you can host a bot on there for free
never tried
idk havent tried
theres a lot of databases
i use a sqlite wrapper
I use mongo
hi, i have js if (args.length > !1) return; member = await client.getRESTUser(args[0]).then((e) => console.log(e)); why is it erroring when i have that if statement?
its erroring at the args[0] bit, but im checking if theres arguments provided then do do whatever
Stupid question ik but is client.uptime the uptime of the token that is given by discord.
Or
The uptime of the instance?
uptime of the node instance
i just changed my servers for my bots they are so smooth now from 148 ping to 100-110 
Okay ty @earnest phoenix
i don't have 240 turkish lira
@slim hollow Türkiye'de durum böyle maalesef
😦
if(args[0] != undefined)
that runs if the first argument is defined
you can check if there are none by doing if(!args[0]) return message.channel.send("some kind of error message to indicate u need args");
How do I make a word counter like whenever someone says pog it counts it and we can do !pog to see how many times it has been said
you need a database to store it
how i use this page? https://risapi.glitch.me/?
what do you mean
how would i start creating commands in separate files in rust
its been bugging me a bit since im not sure where to start since rust is funny 
anyone wanna help me with this? Trying to get my bot to tell the user when it doesnt have the correct permissions. (discord.py)
@client.command()
@commands.bot_has_permissions(ban_members=True)
@commands.has_permissions(ban_members=True)
async def ban(ctx, member : discord.Member, *, reason=None):
logchannel = client.get_channel(720467913144008798)
await member.ban(reason=reason)
msg = (":hammer: Successfully banned ``{}``. Reason: ``{}``".format(member, reason))
await ctx.send(msg)
logmsg = (":hammer: `{0}` banned `{1}` from `{2}` in `{3}` for `{4}`".format(ctx.author, member, ctx.guild, ctx.channel, reason))
await logchannel.send(logmsg)
@ban.error
async def on_command_error(ctx, error):
if isinstance(error, commands.BotMissingPermissions):
await ctx.send("check")```
I dont know how to use the BotMissingPermissions error handler
^this doesnt work btw
Okay so the perfix Can you make it to where it not cap sensitive?
Instead of a lowercase Command Perfix to run the command, you can use both Capital B and lowercase b
? What do you mean by that
what library and language are you using
wtf xddd
what language you're coding in
C
ok, what library
C?
who is supporting what you're writing with the api
like
im using discord.py python
Discord.js
you dont even know what language you're writing in. please do not respond to my question.
would someone with djs v12 knowledge like to help me improve/squeeze down this poor permissions handler https://hasteb.in/woluluvi.js
client.users.fetch("DISCORD ID").send("msg")
is this how you send a msg by id?
if your bot shares a server it'll have a chance of working
kk
If you open up a DBL webhook, is it possible to run more pages?
like /index.html
what is the correct way to implement both commandlist and eventhandler into handler?
well assuming this is necessary
basically i just want the vector of commands to be available to the message function in serenity's event handler
@west raptor cc
well I mean that works I guess unles there are other issues arising, command_list might wanna take self though
why not just use serenity's command handler though?

ah well im just dumb
also what do you mean by taking self, like it doesnt need a type annotation?
Use the message event
Check for channels ID, if it matches add a reaction to it
Note that it's probably doing something else instead of just "reacting to"
Like making a pseudo-button with that reaction
this is my code ```exports.run = (client, message, args) => {
if(!message.author.id.hasPermission("MANAGE_ROLES") return message.reply('You Dont Have PErmission To Create Role !')
if (!message.guild.me.hasPermission("MANAGE_ROLES") return message.channel.send("I Dont Have Permission To Create Role !")
let name = args[0]
if(!name)
return message.channel.send('Please Input a name for create role')
let color = args[1]
if(!color)
return message.channel.send('Please Input a hex code to role color')
var args = message.content.split(" ");
args.shift();
let role = message.guild.roles.create({
data: {
name: name,
color: color
}
)}
await message.channel.send(${role.name} role was created);
}
exports.help = {
name: "createrole",
description: "",
usage: "",
example: "",
};
exports.conf = {
aliases: [""],
cooldown: 5
};that is work but after role created the message isundenefied has been created```
someone can help ?
trying to make bot which supports leaderboards but no idea how to store it in database
every message is kept with a timestamp
and it shows like "Weekly top actives"
can gimme link to docs?
where ?
in front of message.guild.roles.create
gimme example
let role = await ...
you should go back to js basics :l
js is entirely async and promises run on seperate threads, await waits for the function to return, otherwise it just continues even with the value being undefined

What's a pseudo button?
@earnest phoenix a pseudo-button is a button that's not exactly a button
For example, many bots use pagination to navigate through "pages" of embeds
This is done through reaction tracking, so it's not exactly a button
But works like a button
i heard somewhere that discord was improving embeds with buttons and stuff
Yep, actual menus are coming to bots in the next big update
Including right button menus
Oh that will be cool
trying to make bot which supports leaderboards but no idea how to store it in database
every message is kept with a timestamp
and it shows like "Weekly top actives"
how tf do i actually organize the database like this
every single message needs to be kept or atleast a memo of its existance
then sort all messages by user
weekly and monthy
was thinking of keeping a time in db along with userID but how would i combine them all into a number and sort it
i would need to check everything in the collection
Store message count instead
that wouldnt work weekly and monthly
On each message, increase the count
Well, then you're complicating a bit
Rule of thumb is not to store messages older than 3 months
This way you'll suffer less from database size
yeah ill probably clear once it gets to that point
I guess i could get every document which is after a certain date
then i can narrow it down and sort it
-----> Node.js app detected
-----> Creating runtime environment
NPM_CONFIG_LOGLEVEL=error
NODE_ENV=production
NODE_MODULES_CACHE=true
NODE_VERBOSE=false
-----> Installing binaries
engines.node (package.json): 12.x
engines.npm (package.json): unspecified (use default)
Resolving node version 12.x...
Downloading and installing node 12.18.1...
Using default npm version: 6.14.5
-----> Restoring cache
- node_modules is checked into source control and cannot be cached
-----> Installing dependencies
Prebuild detected (node_modules already exists)
Rebuilding any native modules
> canvas@2.6.1 install /tmp/build_549b84710d3da3dc2223fb72560f06ad/node_modules/canvas
> node-pre-gyp install --fallback-to-build
sh: 1: node-pre-gyp: Permission denied
npm ERR! code ELIFECYCLE
npm ERR! errno 126
npm ERR! canvas@2.6.1 install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 126
npm ERR!
npm ERR! Failed at the canvas@2.6.1 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /tmp/npmcache.Ql5wB/_logs/2020-06-18T01_25_23_142Z-debug.log
-----> Build failed
We're sorry this build is failing! You can troubleshoot common issues here:
https://devcenter.heroku.com/articles/troubleshooting-node-deploys
Some possible problems:
- node_modules checked into source control
https://blog.heroku.com/node-habits-2016#9-only-git-the-important-bits
Love,
Heroku
! Push rejected, failed to compile Node.js app.
! Push failed```
help
using mongo so it might have some aggregation
What you could do is, on first message sent every day by each user create a new "day" entry for that user







