#development
1 messages · Page 397 of 1
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/isNaN might want to read this if you are having issues with isNaN
ok thanks guys
ArcBOT - Today at 12:37
Evaluation error!
TypeError: must be str, not Member```
What does it mean?
Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/discord/ext/commands/bot.py", line 846, in process_commands
yield from command.invoke(ctx)
File "/usr/local/lib/python3.6/site-packages/discord/ext/commands/core.py", line 374, in invoke
yield from injected(*ctx.args, **ctx.kwargs)
File "/usr/local/lib/python3.6/site-packages/discord/ext/commands/core.py", line 54, in wrapped
raise CommandInvokeError(e) from e
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: TypeError: must be str, not Member```
ctx.message.author cannnot be concatenated with a string
I not know much about rewrite v may be ctx.message.author.name would work
anyone here use the python library disco
disco or discord.py
eh its very small and considered "alpha"
disco is by b1nzy
ratelimited gurantee
https://github.com/b1naryth1ef/disco #b1nzy likes to dance!
@earnest phoenix whats going on jacz is this acceptable to you https://please.zbot.me/3N9aSEN7.png
no
why
but its ok
why do you pass client? you're only gonna have one client (command func)
nah i have 3 functions in this class
no blake
why do you pass client
you already have it in the constructor
and you're only gonna have one client
so
oh yeah because i hate doing this.client
s m h
Im proud son
thank you dad 
this is so cancer lmfao
why are you even bothering with local storage is my only question
i know you said its if the api goes down but
how often is that gonna happen
i try to avoid local storage at all costs because i just really dislike using it
you're not making a vue app
tbh thank god looks like a pain in the ass
vue is nice
you probably wont like it
its not meant to be simple
like it is
but its not ur average web app lol
its different
like i was considering using it but i dont think it really has many benefits over using something different or just using plain js/jquery
I think local storage is nowadays prefered over cookies
Hey, does anyone know if there is a Google Translate API, where to find it and how to install it on java? owo
Literally the second thing on google https://stackoverflow.com/questions/8147284/how-to-use-google-translate-api-in-my-java-application?utm_medium=organic&utm_source=google_rich_qa&utm_campaign=google_rich_qa
@lunar knot use bing, it's free and effectient.
How would I go about having commands automatic so when I add a new class it can already run the main method
in Java with JDA
classpath scanning
o
halp
so
im making a prefix command
but i get these errors http://prntscr.com/j5cs9r
json I see?
??
possibly they ain’t defined
how does one define them
..
i just wanted to know how to define something
@prisma mist
prefixes =
message =
you define by doing node.js courses
@earnest phoenix why would you insist in making further remarks if you aren’t going to help him.
He asked a question, did you answer it? No
“i just wanted to know how to define something”
@prisma mist here’s some useful Info https://www.w3schools.com/js/js_variables.asp
learning is very helpful plus defining stuff in any lang is very easy
There’s nothing wrong with asking tho
Defining things is the basics of coding. If you don't know how to do that, you have no chance of coding properly.
Take a Javascript course on sololearn!@prisma mist
It's free and will help you
You code properly by knowing what you are doing. If you can't do basic coding or know how to, you should link someone to a site that explains the basics of that language, like defining a variable.
Yes, giving them the answer is helpful but giving them a book (not literally but hypo_____) to learn those answers is even more helpful and effective in the long run.
@cold ginkgo
I also forgot the word that begins with hypo
@earnest phoenix 2 things, first of since klasas base help command doesn't work could i use yours in the meantime? (would credit you if needed) and second you use MongoDB right?
yes and yes
how does it do with SG
fine
is it bugged as sql
no
hmm
i hate nosql but since i wanna get this bot live at some point i need to use sg whats impossible atm
with sql
true
Sql is amazing
How do you even set up postgres?
can anyone help me? I am trying to create a mute command that prevents people from speaking in all channels. It creates a role called "M U T E D" if it doesn't already exist and it goes down to each channel perm to make sure people that are muted can't talk. I am stuck. I can only get the bot to create the role, not the role perms for each individual channel.
here is my code ```const { Command } = require('discord-akairo');
class MuteCommand extends Command {
constructor() {
super('mute', {
aliases: ['mute'],
args: [
{
id: 'member',
type: 'member'
}
],
clientPermissions: ['MANAGE_ROLES'],
userPermissions: ['KICK_MEMBERS'],
channelRestriction: 'guild'
});
}
exec(message, args) {
let meme = message.content.split(' ').slice(1,2);
var argresult = meme.join(' ')
if(!args.member) return message.channel.send('MEMBER NOT FOUND')
let muterole = message.guild.roles.find(name, "M U T E D")
if(!muterole) message.guild.createRole({
name: "M U T E D",
color: "#080808",
permissions: []
})
message.guild.channels.forEach(channel, id)
message.channel.overwritePermissions(muterole, {
SEND_MESSAGES: false,
ADD_REACTIONS: false
})
args.member.setRoles([muterole.id]).then(() => {
message.channel.send(${args.member} was muted!)
})
}
}
module.exports = MuteCommand
Try this for the overwrite permissions:
message.guild.channels.forEach(c => c.overwritePermissions(muterole.id, {SEND_MESSAGES: false, ADD_REACTIONS: false}))
ok thanks
you probably wanna map that and use Promise.all
shite
I wanna do something, not map
i got an error
at MuteCommand.exec (C:\Users\Nicolas Hak\Desktop\Discord Bots\boyobot-js\commands\mute.js:29:35)
at command.parse.then.args (C:\Users\Nicolas Hak\Desktop\Discord Bots\boyobot-js\node_modules\discord-akairo\src\struct\CommandHandler.js:346:56)
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:160:7)
(node:12192) 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(). (rejection id: 1)
(node:12192) [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.
^C
C:\Users\Nicolas Hak\Desktop\Discord Bots\boyobot-js>node .
boyobot is ready nibba
(node:14304) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'id' of null
at message.guild.channels.forEach.c (C:\Users\Nicolas Hak\Desktop\Discord Bots\boyobot-js\commands\mute.js:29:72)
at Map.forEach (<anonymous>)
at MuteCommand.exec (C:\Users\Nicolas Hak\Desktop\Discord Bots\boyobot-js\commands\mute.js:29:27)
at command.parse.then.args (C:\Users\Nicolas Hak\Desktop\Discord Bots\boyobot-js\node_modules\discord-akairo\src\struct\CommandHandler.js:346:56)
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:160:7)
(node:14304) 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(). (rejection id: 1)
(node:14304) [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.```
@earnest phoenix can you show me how to use that Promise.all
Promise.all(array of promises)
Promise.all(message.guild.channels.map(c => c.overwritePermissions(muterole.id, {
SEND_MESSAGES: false,
ADD_REACTIONS: false
})))
Or async/await would be helpful
i dont know how to use async with discord akairo
Hmm well if you know how to do async await normally you just need to make the exec function async and you should be able to use await
@fluid basin thats what we are doing
the promise.all returns this error boyobot is ready nibba (node:16508) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'id' of null at Promise.all.message.guild.channels.map.c (C:\Users\Nicolas Hak\Desktop\Discord Bots\boyobot-js\commands\mute.js:29:80) at Map.map (C:\Users\Nicolas Hak\Desktop\Discord Bots\boyobot-js\node_modules\discord.js\src\util\Collection.js:300:47) at MuteCommand.exec (C:\Users\Nicolas Hak\Desktop\Discord Bots\boyobot-js\commands\mute.js:29:39) at command.parse.then.args (C:\Users\Nicolas Hak\Desktop\Discord Bots\boyobot-js\node_modules\discord-akairo\src\struct\CommandHandler.js:346:56) at <anonymous> at process._tickCallback (internal/process/next_tick.js:160:7) (node:16508) 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(). (rejection id: 1) (node:16508) [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.
Oh okay
muterole is undefined
then muterole is null as it didnt find a M U T E D role
hm
let me try something
@earnest phoenix would you like to see my code again? i could be screwing up somewhere and you can't identify my mistake
sure
class MuteCommand extends Command {
constructor() {
super('mute', {
aliases: ['mute'],
args: [
{
id: 'member',
type: 'member'
}
],
clientPermissions: ['MANAGE_ROLES'],
userPermissions: ['KICK_MEMBERS'],
channelRestriction: 'guild'
});
}
exec(message, args) {
let meme = message.content.split(' ').slice(1,2);
var argresult = meme.join(' ')
if(!args.member) return message.channel.send('**MEMBER NOT FOUND**')
let muterole = message.guild.roles.find(`name`, "M U T E D")
if(!muterole) message.guild.createRole({
name: "M U T E D",
color: "#080808",
permissions: []
})
Promise.all(message.guild.channels.map(c => c.overwritePermissions(muterole.id, {
SEND_MESSAGES: false,
ADD_REACTIONS: false
})))
args.member.setRoles([muterole.id]).then(() => {
message.channel.send(`${args.member} was muted!`)
})
}
}
module.exports = MuteCommand
Oh well
well you create a role but never assign the var to the new role
Okay so, what we are gonna do it
Make the exec function a async function
when you check for no muterole you're gonna await createRole muterole = await message.guild.createRole...
then you're gonna await the Promise.all as well then in .setRoles its addRole
ok
i got this error ```(node:16048) UnhandledPromiseRejectionWarning: C:\Users\Nicolas Hak\Desktop\Discord Bots\boyobot-js\commands\mute.js:24
if(!muterole) await message.guild.createRole({
^^^^^
SyntaxError: await is only valid in async function
at new Script (vm.js:51:7)
at createScript (vm.js:138:10)
at Object.runInThisContext (vm.js:199:10)
at Module._compile (module.js:624:28)
at Object.Module._extensions..js (module.js:671:10)
at Module.load (module.js:573:32)
at tryModuleLoad (module.js:513:12)
at Function.Module._load (module.js:505:3)
at Module.require (module.js:604:17)
at require (internal/module.js:11:18)
(node:16048) 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(). (rejection id: 1)
(node:16048) [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.```
Make the exec function a async function
yeah let me try that
i need to clean up the code
class MuteCommand extends Command {
constructor() {
super('mute', {
aliases: ['mute'],
args: [
{
id: 'member',
type: 'member'
}
],
clientPermissions: ['MANAGE_ROLES'],
userPermissions: ['KICK_MEMBERS'],
channelRestriction: 'guild'
});
}
async(message, args) {
if(!args.member) return message.channel.send('**MEMBER NOT FOUND**')
let muterole = message.guild.roles.find(`name`, "M U T E D")
if(!muterole){
try{
muterole = await message.guild.createRole({
name: "M U T E D",
color: "#080808",
permissions: []
})
message.guild.channels.forEach(async (channel, id)=> {
await channel.overwritePermissions(muterole, {
SEND_MESSAGES: false,
ADD_REACTIONS: false
})
})
}catch(e){
console.log(e.stack)
}
}
await(args.member.setRoles([muterole.id]))
message.channel.send(`**${args.member} was muted!**`)
}
}
module.exports = MuteCommand
``` this is my new code but
i get this error ```(node:15812) UnhandledPromiseRejectionWarning: C:\Users\Nicolas Hak\Desktop\Discord Bots\boyobot-js\commands\mute.js:26
muterole = await message.guild.createRole({
^^^^^
SyntaxError: await is only valid in async function
at new Script (vm.js:51:7)
at createScript (vm.js:138:10)
at Object.runInThisContext (vm.js:199:10)
at Module._compile (module.js:624:28)
at Object.Module._extensions..js (module.js:671:10)
at Module.load (module.js:573:32)
at tryModuleLoad (module.js:513:12)
at Function.Module._load (module.js:505:3)
at Module.require (module.js:604:17)
at require (internal/module.js:11:18)
(node:15812) 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(). (rejection id: 1)
(node:15812) [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.```
async(message, args) this is a function named async
it didnt seem to work for me
shite
how do i turn my code into an async function, i've never understood how to do that
oi i need help with Creating a simple moderation bot
say what you need specifically
what library are you using
you're going to want to just go here: https://discord.gg/CyVmT
ok
how do i do an async function.. take a look at my code and tell me what i did wrong and how i can fix it ```const { Command } = require('discord-akairo');
class MuteCommand extends Command {
constructor() {
super('mute', {
aliases: ['mute'],
args: [
{
id: 'member',
type: 'member'
}
],
clientPermissions: ['MANAGE_ROLES'],
userPermissions: ['KICK_MEMBERS'],
channelRestriction: 'guild'
});
}
async(message, args) {
if(!args.member) return message.channel.send('**MEMBER NOT FOUND**')
let muterole = message.guild.roles.find(`name`, "M U T E D")
if(!muterole){
try{
muterole = await message.guild.createRole({
name: "M U T E D",
color: "#080808",
permissions: []
})
message.guild.channels.forEach(async (channel, id)=> {
await channel.overwritePermissions(muterole, {
SEND_MESSAGES: false,
ADD_REACTIONS: false
})
})
}catch(e){
console.log(e.stack)
}
}
await(args.member.setRoles([muterole.id]))
message.channel.send(`**${args.member} was muted!**`)
}
}
module.exports = MuteCommand
how do i make my bot online
you run it
you keep it alive
I just told you to go to that server for questions @ashen gulch
ok
finna
Profile Command | v2.2.0
Commands:
about Profile-About Command | 2.0.1
nobadges Profile-Nobadges Command | v1.1.1
shop Profile-Shop Command | v1.1.3
Type a!profile command for more info on a command.
You can also type a!profile category for more info on a category.```
Is there a way to invoke a sub command without it interfering with the user arguement of the main profile command!?
Discord py, rewrtie.
Nvm, got it.
How can I make the embed display role pings, not the role objects or whatever? The code is python embed.add_field(name="Roles", value=ctx.message.server.roles, inline=True)
How can I get that to work?
get the role id. . . and make ur bot send <@&roleid> in a embed
Alright.
@earnest phoenix when you are free if i could get some assistance with concatenation and mentions that'd be really nice since you use master too
(not a random ping pls no yell)
yeah no issues
ok good
so basically i've never had this issue before a few weeks ago when i made an update to master
message.author no longer automatically mentions the user, it just gives the ID
i need to use message.author.toString() to get the proper mention
do you know why this is
because its a bit annoying and i have no idea why it happened because i can't find anything relating to this in the commit history
well
you arent doing string concatenation properly then
as toString hasn't changed
and when u do ${something} toString will get called on something
@austere meadow It actually says on docs now that if you .toString() a user object you get the mention.
ofc
always been the case
oh. based on what he said i figured it changed, my b
ok well i am using eslint to change all of my stupid little "things" + "like" + "this" into proper templates
but it did work before
which is weird
can anyone help a brother out with some jimp image manipulation? Is there a way to load an image and send it using ram instead of saving the file, sending it and then deleting it?
I recommend using canvas
Pete cant u just write it on the same file?
but canvas is better than jimp tbh
Yeah jimp is slow as heck
You could also use sharp for more advanced image manipulation
yeah righto, I'll look into it, thanks.
if ur using windows it might take a while its a bit annoying to install
same thing on linux lol
you've got to compile native shit
lol i just got robin bot's addrole remove role to work
im going to do the warning system
if(cmd === `${prefix}addrole`){
if(!message.member.hasPermission("MANAGE_MEMBERS")) return message.reply("Sorry pal, you can't do that.");
let rMember = message.guild.member(message.mentions.users.first()) || message.guild.members.get(args[0]);
if(!rMember) return message.reply("Couldn't find that user, yo.");
let role = args.join(" ").slice(22);
if(!role) return message.reply("Specify a role!");
let gRole = message.guild.roles.find(`name`, role);
if(!gRole) return message.reply("Couldn't find that role.");
if(rMember.roles.has(gRole.id)) return message.reply("They already have that role.");
await(rMember.addRole(gRole.id));
try{
await rMember.send(`Congrats, you have been given the role ${gRole.name}`)
}catch(e){
message.channel.send(`Congrats to <@${rMember.id}>, they have been given the role ${gRole.name}. `);
return;
}```
Use .catch on the rMember.send
also why are you using () around await
await rMember.send(`Congrats, you have been given the role ${gRole.name}`).catch(() => {
message.channel.send(`Congrats to <@${rMember.id}>, they have been given the role ${gRole.name}. `);
});```
btw working code !== good code
ok
members can have nicknames, which will break ur way
ik
not really
no it will still work
<@id> always works
only for checking if something is = to @id it wont work, but theres a regex for that somewher ein d.js anyway
i think nicknames add an ! in there somewhere
```if(cmd === ${prefix}addrole){
if(!message.member.hasPermission("MANAGE_MEMBERS")) return message.reply("Sorry pal, you can't do that.");
let rMember = message.guild.member(message.mentions.users.first()) || message.guild.members.get(args[0]);
if(!rMember) return message.reply("Couldn't find that user, yo.");
let role = args.join(" ").slice(22);
if(!role) return message.reply("Specify a role!");
let gRole = message.guild.roles.find(name, role);
if(!gRole) return message.reply("Couldn't find that role.");
if(rMember.roles.has(gRole.id)) return message.reply("They already have that role.");
await(rMember.addRole(gRole.id));
try{
await rMember.send(Congrats, you have been given the role ${gRole.name})
}catch(e){
message.channel.send(Congrats to ${rMember.id}, they have been given the role ${gRole.name}. );
});```
oof
if ur on d.js v12, yo ucan use member.toString(), turns it into a mention https://img.69420.me/jdWlLHrk.png
adds ! if needed
yeah thats what i mean sry
kk then yes
@earnest phoenix if its in a string it uses .toString on it
smh
literally doing ${member} does member.toString()
On my bot description I have an iframe:
<iframe src="https://some.url/">
Update your browser! We can't display our website because your browser is out of date. :(
</iframe>
Unfortunately I can't use the options width="" and height="".
Does anybody know any other way of how I could set e.g. the height of the iframe?
make a div with width and height and put the iframe in it
Note: This is a list of hosting, not a backing/support for them. You will need to make your own decision.
- OVH: https://www.ovh.com/us/vps/
Starting at $3.35/month (USD), 2GB RAM and 10GB storage, high reliability. - Digital Ocean: https://m.do.co/
Starting at $5/month (USD), 1GB RAM and 25GB storage, high reliability. - Linode: https://www.linode.com/
Starting at $5/month (USD), 1GB RAM and 20GB storage. - Vultr: https://www.vultr.com/
Starting at $2.5/month (USD), 512MB RAM and 20GB storage, plan only available on certain regions. - Amazon(AWS) Lightsail: https://amazonlightsail.com/
Starting at $5/month (USD) (first month free), 512MB RAM and 20GB storage, high reliability. - Time4VPS: https://www.time4vps.eu/
Starting at €2.99/month (billed every 4 months for €11.96/quarter), 512MB RAM and 20GB storage, free backups. - VIRMACH: http://virmach.com/
Starting at $1/month (USD), 192MB RAM and 10GB storage, free DDoS protection, 1 CPU core. - VPSDime.com https://vpsdime.com/
Starting at $7/month (USD), 4 CPU Cores, 6GB RAM, 30GB SSD Storage, 2TB Traffic and 10 Gbps Uplink - Servercheap https://servercheap.net/
Starting at $4.50/month (USD), 2 CPU Cores, 2GB RAM, 30GB SSD Storage, Unmetered Bandiwdth - Scaleway https://www.scaleway.com/
Starting at €2.99/month (Euro), 2 CPU Cores, 2GB RAM, 50GB SSD Storage
Virmach is outdated
What's the updated?
fixed
I use hostinger
scaleway's also good
Didn't use it tbh
@wispy schooner https://jaczaus.me/i/jg0uudv9ba3bb59.png
need to update ram
and storage
and cores
better @earnest phoenix
yes
Where's Galaxy gate @wispy schooner?
Im using servercheap it works perfectly you should add it to the list maybe
php? PHP?
Send me details and I will
wym details
What about vpsdime? @wispy schooner
nah
vpsdime is good
Huh what’s that
Cool?
but i need help
Get the vps ip
@topaz fjord @prime cliff @jagged birch send me details of the hosting providers, such as minimum specs for minimum amount
they also have some ARM ones with more cores and same price but (at least for music bots) i wouldn't recommend arm
@wispy schooner https://servercheap.net/ https://i.imgur.com/sGJ2LEK.png i just recently bought the 3rd one and they have a 20% off event going on
will add a.s.a.p.
is microsoft azure good
@inner jewel https://www.scaleway.com/ ??
yes
I was wondering how I can fix this his errors messages in the dbl server in tried everything
microst azure free you can create your own server hosting
Not sure if I should ask here or api, how would I post the bot status (online, dnd, etc.) on DBL's website?
Ah makes sense.
I bought one of those 30Tb computers, and I installed Ubuntu on it, I want to host website over there, so I installed Ubuntu, now my website is running on 192.168.1.104, as far as I know its private IP address, so my question is how do I find the public IP address? (The one that I can use on Cloudflare for A record)
But I found ip that leads to “Partner” website (its cellular company in Israel)
What IP address leads to my website?
oh u israeli too?
sure
Anyone use http-nextra?
I'm trying to make a simple auto respond cmd and it doesn't work
var greetings = ["Hi", "Hello"]
var respondGreet = ["Hello", "Hi", "こんにちは", "Mornin'", "Sup", "Wazzup", "Sup Brah"]
client.on("message", (message) => {
if (message.author.bot) return;
if (message.content.startsWith(greetings)) {
message.channel.send(respondGreet[Math.floor(Math.random() * 7)]);
}
});
No err message, i think it has something to do with me using a var in the message.content.startsWith
The respond part works perfectly fine.
'greetings'
oh wait
you should do startsWith(greetings[0])||startsWith(greetings[1])
okee
working?
client.on("message", (message) => {
if (message.author.bot) return;
if (message.content.startsWith(greetings[0])||startsWith(greetings[1])
message.channel.send(respondGreet[Math.floor(Math.random() * 7)]);
}
});
returns:
C:\SoupyBot\Storage\bot.js:37
message.channel.send(respondGreet[Math.floor(Math.random() * 7)]);
^^^^^^^
SyntaxError: Unexpected identifier
at createScript (vm.js:80:10)
at Object.runInThisContext (vm.js:139:10)
at Module._compile (module.js:607:28)
at Object.Module._extensions..js (module.js:654:10)
at Module.load (module.js:556:32)
at tryModuleLoad (module.js:499:12)
at Function.Module._load (module.js:491:3)
at Function.Module.runMain (module.js:684:10)
at startup (bootstrap_node.js:187:16)
at bootstrap_node.js:608:3
One message removed from a suspended account.
One message removed from a suspended account.
okay okay
client.on("message", (message) => {
if (message.author.bot) return;
if (message.content.startsWith(greetings[0])||startsWith(greetings[1])
message.channel.send(respondGreet[Math.floor(Math.random() * 7)]);
});
dis?
One message removed from a suspended account.
C:\SoupyBot\Storage\bot.js:37
message.channel.send(respondGreet[Math.floor(Math.random() * 7)]);
^^^^^^^
SyntaxError: Unexpected identifier
at createScript (vm.js:80:10)
at Object.runInThisContext (vm.js:139:10)
at Module._compile (module.js:607:28)
at Object.Module._extensions..js (module.js:654:10)
at Module.load (module.js:556:32)
at tryModuleLoad (module.js:499:12)
at Function.Module._load (module.js:491:3)
at Function.Module.runMain (module.js:684:10)
at startup (bootstrap_node.js:187:16)
at bootstrap_node.js:608:3
One message removed from a suspended account.
@little garnet d.js?
client.on("message", (message) => {
if (message.author.bot) return;
if (message.content.startsWith(greetings[0])||startsWith(greetings[1]) {
message.channel.send(respondGreet[Math.floor(Math.random() * 7)]);
});```
oh wait
nani
nvm
lol
lo
client.on("message", (message) => {
if (message.author.bot) return;
if (message.content.startsWith(greetings[0])||message.content.startsWith(greetings[1]))
message.channel.send(respondGreet[Math.floor(Math.random() * 7)]);
});```
How do I get POST request body with https://github.com/kyranet/http-nextra ?
wut is http-nextra?
HTTP wrapper
hmm
please don't tag all mods @little garnet
One message removed from a suspended account.
One message removed from a suspended account.
What are you looking to find
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
you aren't using plain node, you're using a library
One message removed from a suspended account.
One message removed from a suspended account.
do message.guild.owner.user.tag
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
is it done?
i really can't tell its been there for like 5 minutes
@earnest phoenix if it is done it will let u type commands again
<html lang="en" dir="ltr">
<head>
<meta charset="utf-8">
<style>
body, html {
height: 100%;
margin: 0;
}
.bg {
/* The image used */
background-image: url("https://media.discordapp.net/attachments/427877585788076033/433308593417224192/unknown.png?width=720&height=405");
/* Full height */
height: 100%;
/* Center and scale the image nicely */
background-position: center;
background-repeat: no-repeat;
background-size: cover;
}
</style>
</head>
</html>
Why wont this work ...
For my HTML description
on the site?
How add my bot here ?
me ?
But it is not here on the server
@gilded blaze well
oh it been kicked
ask a mod
@gilded blaze srry for double ping, to use http-nextra to get body use my fork
lol what the fuck
what kind of http lib doesn't have body support by default 
its wip
@inner jewel http-nextra is barely finished
@gilded blaze just use the json middleware
if there are any bugs, do report. and yes ik i need a better middleware system but lazy
Nice
nah, its vpsdime related
Yo
@earnest phoenix
I forgot what i was gonna ask, ffs
ahh
What location do you use for vpsdime
No idea
hm
Ok... What are the args?
no
ah. thanks!
i get it/
client.user.setPresence({ game: { name: 'with discord.js' }, status: 'idle' })
.then(console.log)
.catch(console.error);```
That worked!
[THANKS!!!]
Why doesn't this seem to work? async too btw
# Forceleave server
# @commands.check(ownercheck)
@bot.command()
async def leave(ctx, id):
await client.leave_server(id)
embed=discord.Embed(title="Left server!", color=0xff0000)
embed.add_field(name="ID", value=toleave, inline=False)
await bot.say(embed=embed)
The leave action was from https://stackoverflow.com/questions/48252035/how-to-make-a-discord-bot-leave-a-server-from-a-command-in-another-server
u dont have the toleave?
I removed it as I thought I could pass that with ctx.
dont think that could work cause ur not getting the guild
not a python user but it looks like a error 🤷
Ok, so I would do toleave = client.get_server(id) then?
Removed the quotes to make it read the variable.
is it possible to hook upvote?
think so Joshek also what do u mean @mental solstice
can i inform my bot when a user upvotes it on the discord bot list
the webhook option
ah ill head to the api channel, thank you
guys
i want an example of this dbl.hasVoted("129908908096487424")
if (!dbl.hasVoted("427751395123265546")) return message.channel.send("you have to vote");
not working
i think it returns true or false
yeah i know
so if (dbl.hasVoted("129908908096487424") === false) reutnr message.channel.send("VOTE OR U DIE")
return*
ik
wait i will test it again
It seems like it should work
still not working
if (message.content.startsWith(prefix + 'test')) {
if (dbl.hasVoted("129908908096487424") === false) return message.channel.send("VOTE OR U DIE")
message.channel.send("test");
}
no errors
it say test every time
You forgot to await
that means u voted
Lol
try to do console.log(dbl.hasvoted)
yeah i know
So of course it wouldn't work
it should not say test
yeah when i vote
Without {}
is the webhook url on discordbots.org the url from the webhook i create for my server?
it return if he didn't vote
Yes
It's the IP to send post requests to
if (message.content.startsWith(prefix + 'test')) {
if (dbl.hasVoted(message.author.id) === false)
return message.channel.send("VOTE OR U DIE")
}
Oh wait...
Send code of the hasVoted
i just released that i should put member id not the bot
agh
can anyone help me with this bot in my server
@spring ember
hasVoted is a promise
Don't tag me and I'm not interested in testing your bot for you
0_0 promise
I'll be glad to help but not to test
any documentation on setting up the webhook? downloaded the discordbotlist api package and got auth stuff taken care of
using c#
Do i need to declare an object other than AuthDiscordBotListApi. the only methods im seeing are getvotersasync and another
oh i see.. i can build a list.. ill try it out
You can use the .Net implementation for querying the API. But for webhooks you will need to setup a "server" or at least something that listens on a certain port and handles incoming requests.
yeah, ill need to figure out how to do that, id rather not check for changes to the list constantly
for some reason i was under the impression that using the discord webhook link would work.. the DBL would just send the info to the specified channel
I'd advice an approach that involves caching. Basically whenever you need data you query the API (has Voted for example). Then you just store that information in a cache and clear it every few minutes. That way you won't be using the API too much and don't have to constantly think about whether something is there or not.
Ah yeah. That doesn't work 😅
Ultimately you would want your own database of votes to query against I guess.
ok, i thought the point of the new webhooks was to steer away from api calls
ill handle a list however and go from there, thank you for your time
getting an exception that it cant desearlize the json.. GetVoterIdsAsync
not using anything, the api says GetVoterIdsAsynct returns a list of ulong
Well, you must be using something to deserialize.
Basically the API returns a string of Json and you want to turn that into an instance of an object.
ah, i should use GetVotersAsync and put them into an IDblEntity list?
and loop the elements checking the ids
right thank you
How to make you discord bot online?
do u know any coding languages?
No?
You have to code a bot before you can make it come online
I'd highly suggest looking at how to do this online (YouTube, blogs, tutorials) since it's quite a long process
google python, javascript, java, c# and see which one u like and google "how to make a discord bot in <the lang u pick>"
Ah, you used the lib. Someone should probably make a PR and document 👀
what u mean?
Ah, document that the endpoint is deprecated. I assumed it wasn't documented since this poor fella had trouble with it.
Or at least not handles correctly in the library for .NET since it seemed to try and parse it.
a PR to remove that method?
the official java one also hasn't patched that
@mental solstice Yea, if it's "useless" anyway. I will take a look at it now since I'm home.
can anyone give me full vote code
We don't spoonfeed, no
okay why u don't give us full code in the website
how to save voters
nvm
@uncut slate how to get votes and save them
read the channel description
Do not mention peoples randomly
sorry
Guys if you know how to get check if someone voted or no tell me
i can't understand it
What language are you using?
I'm out of luck here then.
why
I don't use Javascript
.net
if ur using js then....
https://www.npmjs.com/package/dblapi.js and
https://discordbots.org/api/docs#jslib
How do you do in JDA that the bot writes in color?
$ code blocks```
$ very lit fam```
@gilded thunder add pass_context=True in @bot.command() or @commands.command()
Ah, nice! was just wondering what the purpose of the bot would be
@misty shuttle
I need little help with that https://github.com/JoeGandy/ShareX-Custom-Upload
Should I send a server count every time my bot joins/leaves a server?
I see
Glad I asked, because bots.discord.pw doesn't mind sending every time and I was about to do the same here
thanks
How long should the interval be?
15 minutes is probably fine, but it's pretty much your pick
I'll go with at least 10 minutes, or until the next join/leave
Maybe I should post in #topgg-api
@earnest phoenix Also, can you not use the library that was made for DBL and .NET? 🤔
That would tremendously simplify it, unless you plan on doing it all yourself.
https://discordbots.org/api/docs#dotnetlib yea, it pretty much does what you want to do
Yes
No problem. 😃
Sent server count to server 1 and 2 
Oh 
just name its dbots and dbl otherwise if one of them fails you wont know which one is which
I'll have to remember, I just made a loop and those are the indices
hold on
Here's my code https://hastebin.com/ziwiweqaba.cs
😀
i should have just printed the request uri lol
Would be easier to tell apart as you say
also I should have said guild count
Could someone help me with reactions ?
then u relaize he means love reactions
Sorry, was trying stuff.
Ok so I code in Python.
And I'm trying to get the
1⃣ - 9⃣
and the
✔ ✖
as a reaction to a message
but when I use the unicode it says that it's not a emoji
I've used on_reaction_add to get the unicode
To get those just do \ in front of the emoji so eg \:smile: would give \😄
Also it's good that it worked 👍
The \ escape doesn't work on mobile btw
and you can't use \1⃣
Weird
yea
I'll try some unicodes see if I can find any that work
I'll past them here if I find one
ok
Idk why but our site on chrome streches a pic and on edge it works fine
$help
%help
Is there anything thats not a command
-;
`help
*help
(help
(help)
commands go in #commands #265156322012561408 or #265156361791209475
Does anyone know anything about python?
And what do you guys develop your bots in?
discord.js?
JDA + scala
i use discord.js
npm i discord.js

pythonic 😍
@tiny lodge not everyone wants to be on master
I'm just recommending it ig
why would you not use npm i -S discord.js
if you want to install djs master @unkempt dew
title: 'Toto - Africa (Video)',
requester: 'Tetra' }
internal/child_process.js:330
throw errnoException(err, 'spawn');
^
Error: spawn EACCES
at ChildProcess.spawn (internal/child_process.js:330:11)
at Object.exports.spawn (child_process.js:500:9)
at new FfmpegProcess (/root/ium/node_modules/prism-media/src/transcoders/ffmpeg/FfmpegProcess.js:14:33)
at FfmpegTranscoder.transcode (/root/ium/node_modules/prism-media/src/transcoders/ffmpeg/Ffmpeg.js:34:18)
at MediaTranscoder.transcode (/root/ium/node_modules/prism-media/src/transcoders/MediaTranscoder.js:27:31)
at Prism.transcode (/root/ium/node_modules/prism-media/src/Prism.js:13:28)
at AudioPlayer.playUnknownStream (/root/ium/node_modules/discord.js/src/client/voice/player/AudioPlayer.js:97:35)
at VoiceConnection.playStream (/root/ium/node_modules/discord.js/src/client/voice/VoiceConnection.js:483:24)
at play (/root/ium/index.js:242:43)
at Object.play (/root/ium/index.js:273:5)
root@ium:~/ium#```
Getting this error, when I try playing music with my bot...
(Note: This is on Ubuntu/Server)
iirc it's a permission error
https://stackoverflow.com/questions/19009778/running-node-express-on-linux-produces-error-spawn-eacces the answer here should fix your issue 
#define EACCES 13 /* Permission denied */```
@heady zinc Says this when I try to install it
chmod: cannot access 'APPNAME/file': No such file or directory
you're supposed to replace this part 
the path to it should work yeah
Same error
unless it's based on the exact file that spawns it rather than the process itself
then you would need to do that for ffmpeg ?
idk much linux soo
The reason why it's not working because it's the wrong path.
Maybe use a full path?
Hey guys, I'm fair new to this stuff so I hope this is the right place to post my question, but I've been trying to make a Fortnite bot on node js and here's the part of my code that's wrong. I used "npm init fortnite". Would be great if somebody knew what I need to do to fix it, thanks! 😁
const Fortnite = require("fortnite");
const ft = new Fortnite("APIKEY");```
This is the error that it is coming up with
Fortnite is not a constructer```
I don't know this module, but to explain it... Whatever the index file of the fortnite module is exporting is not a Class, thus not being able to invoke new
Read the package's README.md
If it has one (Should have)
Here's the readme https://github.com/Jake-Ruston/fortnite/blob/master/README.md
There's a small snippet of code and that's basically it
hmmm fornit
Right there in the example it tells you to do
const { Client } = require('fortnite');
const Fortnite = new Client(/* ... */);
yeah you didn't do that
Not exactly what is written there, but copy and pasting on mobile is annoying, but yeah
you just named the variable Fortnite, didn't grab the Client class
Oh I see, I thought the { Client } was a name of our choosing
Nop
no it isn't
@trim plinth no
:(
const { Client } = require('fortnite'); is the same thing as const thing = require('fortnite').Client;
its somethin called stylish @trim plinth
reee
I watched a youtube guide and the youtuber used his own variable names for the { Client } 😅
#GithubGiveUsOurDarkTheme
Well
He either did by doing const anOwnName = require('fortnite').Client
or did const { Client: anOwnName } = require('fortnite');
Else it is just wrong, or an outdated video
Get your api key by signing up here - https://fortnitetracker.com/ The Fortnite Package we used is here - https://www.npmjs.com/package/fortnite ••••••••••••...
wait u can do { Client: ownname }
Here it is, it was only 2 weeks ago so I assumed it was recent
Yes you can
¯_(ツ)_/¯
I would watch the video, but again, that's the right way of doing so
Follow the docs, always help
too lazy to watch the video™
thats because the guy who made the fortnite package updated it

very recently
yeah that's probably it then
Sounds perfect then, thank you for all the help guys! 😄
@deep lark np
@earnest phoenix Can ya help me with servercounts? I see how you did it on your website, but i can't get it to work on mine. https://glitch.com/edit/#!/rare-expert?path=views/index.html:262:7
that's my code
how did you get it to work?
ik you had to get the servercount with node
maybe...??
@earnest phoenix is a bot that pms everyone on ur server ok? u will need admin perms??? is that ok
API abuse
And don't tag solace for questions anyone can help you
Also the @everyone role
seems.. lazy
It's not and it's actually intuitive in a way
is open source bots allowed??? i made it and made it open source
As long as your token isn't public
yep just mine
Which is bad anyway
yeh
I can see why they do it, but it made my whitelist feature have a caveat therefore it's lazy 😂
Make sure it's not an unmodified fork or little modified @cursive dagger
why i am the one that made it and did it open source on github @spring ember
Wdym is it a fork?
nope
Yeah it is
yep i uploaded it to github to make so other ppl can use it
I'd guess you'd be in the majority with that epic 😉 like dondish said just make sure your token isnt accidentally in your code anywhere
That's the idea of open-source yeah
ok i am gonna try applying it here
Do you host it ?
Hey guys, having troubles with changing bot username.
Changing appname in discordapp.com doesn't seem to work, changes don't apply
How can I do that?
thank you!
Anyone know how to properly post a body from ifttt twitch to webhooks? I keep getting a Error 400
http://prntscr.com/j6aosj
guys how to get info from any website and send it in message using JS
Can you click on show details?
yea my youtube one works fine just twicth im having issues with one sec
{"content": {{CreatedAt}} **{{VideoTitle}}** : {{VideoUrl}}"}
Oh, I thought there is like an error description
my youtube one { "username":"ESO Assistant","content":" {{AuthorName}} uploaded a video {{CreatedAt}}: {{Url}}" }
@tiny turtle How to get info from websites
tried that changing the stuff to the twitch stuff first and it was 400 also
???
He wasn't talking to you
ifttt twitch to webhook
@tiny turtle show me your current body rn
{"content": {{CreatedAt}} {{VideoTitle}} : {{VideoUrl}}"}
You didn't open the content value with a "
Np
How can bilud bot need help?
is the discordbots.org down?
We're aware of the issues, it's being looked into
ok thank you, making sure i didnt get rate limited or something, only making 2 api calls per minute
Not entirely development related, but I miss my 16 GB RAM for development. 8 GB feels like such a downgrade if you multitask a lot. 😦
@earnest phoenix Do you know any programming languages?
Anyone experienced connectivity problems with their bots and Discord or DigitalOcean in the past 12 hours?
.
Anyone know how to use pastebin api in python???
@earnest phoenix yes, Memes sent me my bot is down and the websocket wasn't connected. it sucks
connectivity problems != offline
*12h
I had websocket disconnections where my bot was online but unresponsive
@spring ember dang
And now I can't connect to DigitalOcean because the verification codes they send to my email don't work
oof rip
oof
This is why you don't use ovh :^)
Can someone help me with servercounts? I see how solace did it on his website, but i can't get it to work on mine. https://glitch.com/edit/#!/rare-expert?path=views/index.html:262:7
that's my code
Do you have to use the dblapi.js module?
no, you can make simple post requests
https://discordbots.org/api/docs#bots go to post bot's stats
How can I invite my bot here?
Ok
How do I make a remainder command in JDA
reminder? remainder is Integer % Integer
if reminder I suggest you to read about ScheduledExecutors
Prescribed. Sorry. Meant restart
use a service in linux, threads, wrapper I personally don't use one
ok i have no linuk
you don't really need a restart command though and the implementation is up to you
@spring ember What are the bot objects? How would I add them to my code? Are they node.js?
bot objects are the names of the JSON objects
I still don't know how to get this to work
😦
How do i use JSON
oh I get it ok
in my website?
what language?
HTML
js is really ez
and/or js
html is not a programming language
read about AJAX
Hey, I'm looking for some help with listing a guild's groups in a rich embed using discord.js
I'm not asking for spoon feeding, btw, im just looking for osmething that might help
Do you mean roles?
what's the probelm @cunning oxide
and then put that as an object @toxic oracle?
//so like this?
.addField("Roles", `${r.name}`)

no you need to join the array
with delimiter \n
http://donbot.space/i/1416f79.png why isn't this embedding?
Have you checked if the channel exists? And that you don't accidentally escape it?
Do you escape it then?
\[#development](/guild/264445053596991498/channel/272764566411149314/)
would be escaped for example
@low owl
oof it is
How did that happen if I may ask? 😛
It should remain the exact value that you used to insert it
So you probably already insert your data escaped
I do but it shows it to me unescaped in pgAdmin
Mh, not sure why that is
I'd recommend storing the ID of the channel rather than the mention string
😛 well time to make the deescaper
Then fetching the channel when needed
no I save the whole string
You will only run into trouble with that, such as probably breaking the Discord ToS. 😛
why? welcomer messages are not against the ToS
You can get the string name from the id itself.
Don't you need like a note saying we store channels names?
?
They aren't but you are not allowed to store data longer than needed (etc.) and have to delete it after a while
if you use a string it might be a bit complicated to ensure the channel does not exist anymore
or update your db accordingly
Not like anyone would care too much about the ToS, but there are only benefits in using the id as key instead of the string.
Brian make so much sense, I should stop storing his history in a secret database.
👀
lol
👀
thanks brian!
How to get the first (aka default) channel of a guild nowadays since of the implementation of channel categories?
at least in discord.py you can just get the first item in the list (guild.text_channels)
to get the system channel you can do guild.system_channel
sorry d.js
filter and use type property
@prisma mist I'll help you fix it







