#development
1 messages ยท Page 381 of 1
np
The only problem with it is that it lists the word var instead of that variable (even if I use \n${var})
Ok, I forgot "", now it works ๐
o.o
how do u use guildEmojisUpdate in discord.js?
anyone :/
I don't believe guildEmojiUpdate is a thing d.js
!serverinfo
?serverinfo
got muted 
anyways
Discord.js is being weird and not letting my bots use embeds for some reason? I tried two different ways of embed building, the embed builder and the ordinary embed making way both didn't work and I can't live without embeds 
show code and errors?
does the bot have embed perms?
that was my next question yes
Oof
mk
const noU = new Discord.RichEmbed()
.setAuthor("no u");
message.channel.send(noU);
``` of course this would be different by command but this is basically what I was doing, randomly stopped working like a few days ago. Returned no error 
Plus, it should have embed perms since in my testing server it has admin + the invite link gives admin perms to the bot unless unchecked
return message.channel.send({
embed:{
color: 0x007acc,
description: "Some description here",
author:{
name: "Author name",
url: "some url",
icon_url: "some url"
}
}
})
That would work too
I tried that as well, didn't help
@river compass
Well I usually call the variable embed and do message.channel.send({embed});
that works for me at least
Yeah, I said that I call it embed
it has to be called embed 
lemme try that
const infoEmbed = new Discord.RichEmbed()
^
ReferenceError: Discord is not defined```

const Discord = require("discord.js")
I required it lmao
in the same file?
yep

const {RichEmbed} = require("discord.js")
dont use builders, its so much easier going raw ok

builders are better if the embed will have a different layout based on runtime information
Even when I use raw, it still returns the error 
eg a field will only be there if x is 1
Ew raw
if(x === 1) {
builder.addField(...)
}
show more code?
or be me and scala new Embed { title = "kek" if(x == 1) { field.name("x").value("is one") } else { field.name("x").value("is not one") } }
Oof
const infoEmbed = new Discord.RichEmbed()
.setAuthor(bot.user.username, bot.user.displayAvatarURL)
.setColor('#1f8b4c')
.setThumbnail(bot.user.displayAvatarURL)
.addField('Username:', bot.user.username, true)
.addField('Discriminator:', bot.user.discriminator, true)
.addField('ID:', bot.user.id)
.addField('Prefix', 'chi!', true)
.addField('Help Command:', 'chi!help', true)
.addField('Creator:', 'snarkyllama#4331', true)
.addField("Created at:", botAccountMade, true);
message.channel.send(infoEmbed);
and the error is that Discord is not defined?
yup
show the full code then
mk
Hey, could anyone point me into the direction for making custom images with node.js? Such as this
Ok thank you
canvas best
ye

Although canvas is a pain in the ass to install on windoes
exports.run = function(bot, message, args) {
const Discord = require('discord.js');
let botAccountMade = '';
let botDate = bot.user.createdAt.toString().split(' ');
botAccountMade += `${botDate[1]}, ${botDate[2]}, ${botDate[3]}`;
const infoEmbed = new Discord.RichEmbed()
.setAuthor(bot.user.username, bot.user.displayAvatarURL)
.setColor('#1f8b4c')
.setThumbnail(bot.user.displayAvatarURL)
.addField('Username:', bot.user.username, true)
.addField('Discriminator:', bot.user.discriminator, true)
.addField('ID:', bot.user.id)
.addField('Prefix', 'chi!', true)
.addField('Help Command:', 'chi!help', true)
.addField('Creator:', 'snarkyllama#4331', true)
.addField("Created at:", botAccountMade, true);
message.channel.send(infoEmbed);
}
@languid dragon this is all of the botinfo code, the exports.run is because this is a multi-file command handler
put it outside of the exports.run function
Putting it outside would cause the message to not send
@trim plinth wuts error?
"Discord isn't defined" 
Wut the fuck
I usually put the Discord declaration outside of the command function, I don't know if that would affect it or not
That wouldn't change anything
All that would do is take it out of the variable imports
I don't know what to suggest then, unless maybe reinstalling discord.js
I tried that already
If there isn't a solution or problem in the code I'll just have to hit up the discord.js Discord
Somebody help me if there's something wrong.```client.on('guildMemberRemove', member => {
if (member.guild.id != ${message.guild.id}) return;
client.guilds.get(${message.guild.id}).channels.get(${message.channel.id}).send({
"embed": {
"description": ":gem: User leave server:\n\n\nNome: " + member,
"color": 65535,
"thumbnail": {
"url": url
}
}
});
});
client.on('guildMemberAdd', member => {
if (member.guild.id != ${message.guild.id}) return;
client.guilds.get(${message.guild.id}).channels.get(${message.channel.id}).send({
"embed": {
"description": ":gem: User Join server:\n\n\nNome: " + member,
"color": 65535,
"thumbnail": {
"url": url
}
}
});```
error?
yes
what is if (member.guild.id != `${message.guild.id}`) return; supposed to do
That gives me an impression that event is connected under a message handler event
aaaaa
I did not know why they are new so I saw some videos on youtube and docs from discord.js
Can you show the error?
What are you trying to achieve with that line?
you cut off the whole error message
I do not know exactly
yes
Thank you for the help.
isnt message.guild.id a string already
so its just being put into a template literal and just made into a string again?

I need no thank you
@earnest phoenix js async run(msg, args) { const { body } = await this.bot._snek.get('https://nekos.life/api/v2/img/neko'); msg.channel.createMessage('**[Neko]**: Here is your neko:', { embed: { title: "Click me if the image failed!", url: `${body.url}`, image: { url: `${body.url}` }, color: this.bot.utils.colour() } }); } :^)
don't ask why utils has the colour() function kthx

whats the url it sent?
dude, it's actually grammar
๐ @trim plinth
dude, it's actually called I was being sarcastic
@visual surge
@earnest phoenix once a mod approves
how long does that take?
1 hour to a week
oof
asking a mod delays the process
;-;
@earnest phoenix any bot that is offline while they are reviewing gets denied
shit
must have 24/7 hosting
ish ish
some bots on the website
as long as it's online most of the day
mine is
Dont submit tho if your bot is offline for more than 7 hours a day
for me its manual
nah
my bot is offline 5 hours a day
school and shit
but yeah
By chance can i get any help with this?
im trying to do a setgame with my bot
async def on_ready(self):
print(f'Ready: {self.bot.user} | Servers: {len(self.bot.guilds)}')
await self.bot.change_presence(game=discord.Game(type=0, name=f"xa.help | on {len(self.bot.guilds)} servers!"), status=discord.Status.online)
but in my cmd window it gives me:
TypeError: change_presence() got an unexpected keyword argument 'game'
try activity
I was thinking it was something simple and i was just being dumb -.-
Thanks for the help though!
Cany anyone help?
https://hastebin.com/bikideqaju.json
What am I doing wrong?
http://prntscr.com/ip0v7v
I am trying to pull the top five searches.
this is the outcome
no code
"hi what's wrong?"
^hastebin
that's just json
^thats what made the screen shot
200 how am i failing
isn't that suppose to pass/
Im at a loss, first time ive done this though, use a web address to get values with xpath
Is there an easier way that you guys know of?
@tiny turtle you have to show actual code not Json and a picture
That is the code, read it
the code made the pic, im just learning and this was the easiest way for me
Is there an easier way I dont know
Omfg
How are you sending an embed with a Json file then
um "title": "Announcement from ${tempVars(\"Username\")}", "author": "", "color": "${tempVars(\"hex\")}\"", "timestamp": "true", "url": "", "authorIcon": "", "imageUrl": "", "thumbUrl": "", "storage": "1", "varName": "ann-embed", "name": "Create Embed Message" },
{
"behavior": "0",
"url": "https://us.tamrieltradecentre.com/pc/Trade/SearchResult?ItemID=&ItemNamePattern=${tempVars(\"search\")}",
"path": "list[0].example",
"storage": "1",
"varName": "example",
"name": "Store Variable From WebAPI"
},
{
"title": "Your search for ${tempVars(\"search\")} came back with:",
"author": "",
"color": "0x2e8b57",
"timestamp": "true",
"url": "",
"authorIcon": "",
"imageUrl": "",
"thumbUrl": "https://us.tamrieltradecentre.com/Logo.png",
"storage": "1",
"varName": "ttcprice",
"name": "Create Embed Message"
},
{
"storage": "1",
"varName": "ttcprice",
"message": "${tempVars(\"example\")}",
"name": "Set Embed Description"
},
{
"storage": "1",
"varName": "ttcprice",
"fieldName": "Item 1",
"message": "${tempVars(\"Item 1\")}",
"inline": "0",
"name": "Add Embed Field"
},
did you look at it?
it was easier for me to learn all this short stuff
doesn't look like a embed to me
How is he sending an embed with json
Like sending it to the discord channel
What lib are you using?
msg.channel.send('', {
embed: {
// embed content
}
});
``` this is how to make a embed with JSON
all my comands, like all look like that

@tiny turtle what library and language
the bots in here, the only issue I am having is in the screen shot
one command wont pull the values
What library and language are you using
um node and javascript and obviously json
Show the JavaScript code then
there is none for this command and there is at the same time if youd click the link lol
thats all the code that made the screen shot
100%
I just dont know why it isnt pulling the values with the 200 code
200 seems it should be fine right?
200 no

i need
400 is no, 200 is ok i thought
it literally says success false lol
lmao
does the callback for the url give back 2 params?
yea
I wouldn't rely too much on html status codes I have seen apis return 200 with errors
I used data mine to get the xpath
datamine?
first time if used this methos
yea to pull the xpath and used thier search link as they dont have api and i got permissions
//tr[9]/td
You guys cant help I am taking it? All good ill keep playing with it and sorry about mess I made lmao
pyra_ ?
yes kyle
Wowie
I got an error i never got before
(node:3360) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 2): Error: 403 Forbidden
(node:3360) [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.
Code:
if (message.content.startsWith(config.prefix + "no u")) {
message.channel.send({
file: "https://cdn.discordapp.com/attachments/418247617097498639/418574288522575883/NoU.jpg"
})
} else
the other commands with the same "setup" work fine
your bot may not have the permission to upload files in this channel/server
process.on('unhandledRejection', error => console.log(`unhandledRejection:\n${error.stack}`))
.on('uncaughtException', (error) => {
console.log(`uncaughtException:\n${error.stack}`);
process.exit(); // better to exit here.
})
.on('error', error => console.log(`Error:\n${error.stack}`))
.on('warn', error => console.log(`Warning:\n${error.stack}`));
@olive ridge ^ you should put that at the bottom of your main file
it makes the unhandled rejections a bit more clearer
spoon feed me senpai

moar
no u
use \n
Yes, but how do i do so if i dont want to manually input it
???
How do I check if a channel exists? I tried this:
if(command === "exists") {
if(msg.guild.channels.exists("general", "text")) return msg.channel.send("exists.");
msg.channel.send("doesn\'t exist.");
}```
the channel general does exist, and the bot can see the channel but it says it doesn't exist. am i doing something wrong?
How would I create a voice channel? I've tried doing js message.guild.createChannel('test', 'voice'); but that just created a text channel. The discord.js docs says that you should do it like that but it just creates text channels
works for me..
msg.guild.createChannel("test", "voice");```
@quiet bobcat
works for me, maybe you need " instead of '
Shouldn't do any differance because they are both strings. But I can try
Yeah, idk.
Same thing :/
Ok, thanks for your help
np
@quiet bobcat make sure you're using the docs for the version you're using
I am using the docs for my version
yes
@quiet bobcat lib?
discord.js okay
what the frick
i presume stable
the discord.js docs for stable say .createChannel(name, [type], [overwrites], [reason])
I'm using master though
wait
it changed from master to stable 
createChannel isn't in the docs on master
huh
weird
use https://discord.js.org/#/docs/main/master/class/GuildChannelStore?scrollTo=create instead of Guild.createChannel()
apparently in v12 most of the stuff has been changed to extend collections and contain the methods related to it
so Guild.channels not only is a collection allowing you to get informations but now also is the interface to create channels for example 
@quiet bobcat
guild.channels.create does make sense
Yeah
as much as guild.createChannel() did if you ask me
just feels kinda bit weird as collections's first purpose is to contain data
not to interact with the api in any way 
well now they do
How can I delete a certain row in sqlite3? 
v13 is out if ur talkong about d.js
no its not 
I am looking for a person who can create an order for my bot which is already created but nothing
i need a bot, which will give Member role when you type -agree in Rules
like when u join a new server you dont have any Roles, to get special role you need to type -AGREE so you get special role to access other rooms (channels)
i am using python and when i am using an async code the console logs it as invalid syntax. the time is is that the console has never do this befor
please ping me
Who can help me with my discord.Js in french please ?
@mental willow are you even using python3
I am using the discord.py rewrite with Python 3.6.4.
Here is my code:
async def on_guild_join(guild):
print('I have joined a server!')
await self.bot.change_presence(activity=discord.Game(type=0, name=f"xa.help | on {len(self.bot.guilds)} servers!"), status=discord.Status.online)
In my cmd window I get this error when the bot joins a guild:
TypeError: on_guild_join() takes 1 positional argument but 2 were given
@fickle hawk you don't have self defined, since you have it in your code it doesn't know what to do with it
self.bot = bot
try this async def on_guild_join(self, guild)
inconsistent use of tabs and space in indentation
xd
oh, you literally just copied my code over yours xd, put : at the end of my code
yes i did xd
I am still getting the same error
@abstract mango I am only using tabs
I am still getting a inconsistent use of tabs and space in indentation error ;-;
then you aren't using only tabs

oof code sprints are tiring
(node:2079) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 2): TypeError: Converting circular structure to JSON
(node:2079) [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.
events.js:183
throw er; // Unhandled 'error' event
^
Error: socket hang up
at createHangUpError (_http_client.js:331:15)
at TLSSocket.socketOnEnd (_http_client.js:423:23)
at emitNone (events.js:111:20)
at TLSSocket.emit (events.js:208:7)
at endReadableNT (_stream_readable.js:1056:12)
at _combinedTickCallback (internal/process/next_tick.js:138:11)
at process._tickCallback (internal/process/next_tick.js:180:9)
drop tables 
just ask your question
ok
<?php
require 'connect.php';
function get_data($request)
{
if ($result = $mysqli->query("SELECT * FROM API")) {
while ($set = mysqli_fetch_assoc($result)) {
$data = [
'server_count'=>$set['server_count']
];}
}
foreach($data as $data=>$info)
{
if($data==$request)
{
return $info;
$result->close();
$mysqli->close();
break;
}
}
}
?>
so theres my php code
and its for my api
any ideas why its not wrking
<?php
header("Content-Type:application/json");
require "api_data.php";
if(!empty($_GET['request']))
{
$request=$_GET['request'];
$data = get_data($request);
if(empty($data))
{
response(200,"Error!",NULL);
}
else
{
response(200,"Success!",$data);
}
}
else
{
response(400,"Invalid Request",NULL);
}
function response($status,$status_message,$data)
{
header("HTTP/1.1 ".$status);
$response['status']=$status;
$response['status_message']=$status_message;
$response['data']=$data;
$json_response = json_encode($response);
echo $json_response;
}
and theres the api.php that uses the top php script
what is this?
!joinserver
testing
https://media.discordapp.net/attachments/222078374472843266/422153107640942603/unknown.png?width=140&height=375
quick question but, would this be where I am getting my '11 Listeners possible memory leak' warning from? I went through using
>eval bot._events.ready[43].toString()
to see what each event was and the [0] event was the full script in the 'READY' listener while [1] - [43] was
() => {
this.postStats();
setInterval(() => {
this.postStats();
}, 1800000);
}
^ this snippet for posting the bot stats to discordbots.org
and then this is how the results look when I use >eval bot.action
is there anyone that knows their way around python3?
hm
can i pm you?
does a discord bot token change by itself eventually, cause my bot token as regenerated by it self cause I checked and matched it to the current one I have set in my script and it is different than the one that it shows now. what causes it to auto regenerate a new token?
Only changes after 1,000 successfull logins to the websocket in 24 hour period
iirc, refreshing the page also regenerates it, so by opening the page again it will generate a new one
tokens are invalidated only by sending 1k (2k if your bot has large bot sharding enabled) IDENTIFY payloads in 24h or clicking the invalidate token button
when you refresh the page it does create a new token, but all are still valid until you manually invalidate them
^
well when I opened my bot's page, my bot stopped working ๐ค
I did not
You probably did
If they refreshed your token on page visit that would fuck over a lot of people and cause you to never even configure your app anymore
ok, thanks good to know it wasn't something else. Cause my bot won't boot back up saying ! TypeError: Cannot read property 'username' of null but I didn't change my script in 2 days and it was working until I rebooted the bot. and all the values that use the username property I know I am using correctly. Anyway ill look at it more then and see what happen with my luck I probably did mess something up lol
"This token changes on page refresh and is valid unless manually regenerated below."
@bright karma just to say, every time you refresh the page, new token is generated
this doesn't affect any other token you're using though
unless you regen
ok thanks
np
btw, the 2nd part of your token is safe to flash too :b
^
first and second mean close to nothing
first is used to know who did the action, second idk, third is the authentication
I'd like to know what the 2nd part is for
3rd part is probably some HMAC with password
or whatever it would be for bot tokens
anyone knows how to set config vars in heroku with python and github
bot.run(BOT_TOKEN) doesnt seem to work
3rd is HMAC, 2nd is token generation timestamp @bitter sundial


MzA4MjkzNjAzNTMxMjkyNjcy.DN9r_A.brcD2xRAqjAGTuMcGPwy4TWVQdg Got it

does anyone have any ideas on how I can make my strawpoll command less clunky?
currently it is +strawpoll {title} [option 1] [option 2] [option 3]
My submission for certification said it was kind of clunky but I'm not really sure how I can improve it
@river dawn what does {} mean? optional or required?
It's just a way to seperate the title from the options
i feel like the title isn't important and therefore should be optional because its most likely that you'll be directed to the strawpoll from another user
if i was designing something like that, i'd have it like strawpoll (options ...) [title]
if no title is provided you can just default it to something like "Strawpoll Poll"
no problem 
โค
anyone have any exp with xpath have any idea why I keep getting these errors?
https://us.tamrieltradecentre.com/pc/Trade/SearchResult?ItemID=&ItemNamePattern=
Trying to pull some values from here and this is what I get
Could not store a value from path //section/div/table/tbody/tr[3] | //section/div/table/tbody/tr[5] | //section/div/table/tbody/tr[7] | //section/div/table/tbody/tr[9] | //section/div/table/tbody/tr[11], Check that the path is valid!
p!daily
๐
anyone experienced with ytdl-core? Need to know how to restrict videos over 1 minute being played..
can't find anything on the npm site, but i've seen people do it before ๐ค
get the information of the link -> has song length
o ye ty
i have that as my description
pls
and it dont work
this makes the website experience 100 times worse
well
lemmie remove it from that page
yes
that antiadblock stuff is so annoying
and makes me just block more antiadblock script
than anything
Have you set frame width and height
ok
nope
<iframe src="https://rltrading.org/pages/bot/" height="200" width="300"></iframe>
mhm
this is confusing
hey @bitter sundial
u know why?
?
mhm lemmie check where i enable it /:
ok @bitter sundial i did $config['enableClickjackingProtection'] - default: true to enable it now theres just an error for it
An unexpected error occurred. Please try again later.
anyone?
@gilded plank
?
yooo @bitter sundial i dont understand why its not working by default X-Frame_options is set to sameorigins
and yes
i have to
mk
itz one command
if my bot was accepted, because it does not appear on this server?
-bots @raw wharf
@wise bloom
when they accepted it they added it to another server [not where they test the bots]
xd
I'm wondering if someone could do html and css for a friend of mine. He'll pay $5 for it
For a bot?
um. it's a website
๐
๐
Don't they have free ones online?

why use bother with complex html and css when you can just have your entire website be java based with the browser plugin
^
=> Why bother with that (and require java download and plugin permission) when you can just make it with Unity and do a web player
entire website in markdown
@olive ridge he knows some html and css, he just doesn't have the time to make an entire dashboard for himself
what does he need it for?
His bot
is it a hobby project?
He has a bot and he wants an online dashboard so that you can control it online. Call it whatever you want
Doing it for fun
Then wouldn't point of it to be to code it from scrath
at this point
you might as well just hire a professional to do it
then us skrubs'
or actualy code it your self
I need some help with my server count poster.
I am using the discord.py rewrite and Python 3.6.4.
Here is my code:
https://hastebin.com/nejokaquxu.py
That is my events cog
In my cmd window I get this error
This is for line 29:
async def on_ready(self):
^
TabError: inconsistent use of tabs and spaces in indentation
After fixing that
https://hastebin.com/xoqokuhedu.py
Now I get for line 35:
payload = {"server_count" : len(self.bot.servers)}
^
TabError: inconsistent use of tabs and spaces in indentation
do i not need to tab those at all? 
I played around with it a bit and I got it to run
but
it didnt post anything to the api
add some debugging
anyone here use Discord Bot Maker? #NoHatePlease
real bot devs make bots the real way
xd
I honestly need to google what this discord bot maker thing even is
DBM can be used for bot making its just really shitty compared to making a bot from scratch
I can imagine, literally everything that is made to make something without proper knowledge will never have enough possibilities
And you have to pay for DBM. Like you can either learn programming and make a high quality bot, or pay to make a lower quality bot 
I'd say it's pretty obvious: either be lazy and pay, or work your way to make something yourself for free
@earnest phoenix I got a 403: Forbidden error while trying to post server count
Mistake in your token or bot id?
Does anyone know how to have something like the following?
User in #general: -apply
Bot in DM: Welcome to the staff application! Please answer the following questions. Age?
User in DM: 21
Bot: Time zone?
User in DM: EST
```and so on.
Most libs should have waiting for messages
What do you mean? I'm using Discord.js
I want to be able to post the responses in a channel.
@quasi marsh ^
When you do -apply make sure to save their responses, the message contents e.g. and then compile them and add them to an embed, post that in #general
I don't know how though.
Should be able to get the channel from the message quite easily
Me neither because I don't use JS
That's why I'm asking...
I think you can use a MessageCollector
Not sure tho
Can anyone figure out why my bot, @nocturne mist has no game status? It is coded in python. DM me for the pics
you can just post them in chat 
yeah but it would be making solving the problem faster if you were to just post them in chat instead of DMing them
what r the icons everyone uses in their richembeds?
do you mean the image, thumbnail or the author/footer icons?

show code
ok
"embed": {
"color": 15053865,
"footer": {
"icon_url": "https://cdn.discordapp.com/embed/avatars/0.png",
"text": "FrenzyBot"
},
"thumbnail": {
"url": "https://i.gyazo.com/97f89426bc5a5373f1748b45bdf1761d.png"
},
"fields": [
{ "name": "Messages",
"value": "info: Provides information about this bot."},
{ "name": "NSFW",
"value": "pornsearch: Returns Random Porn\nporngif: Returns Random Porn Gif\npornvideo: Returns Random Porn Video"},
{ "name": "Useful",
"value": "purge: Purges Messages In Current Channel\nshorturl: Shortens a URL based using goo.gl"},
{ "name": "Fun",
"value": "ascii: Gives you text in ASCII.\nchucknorris: Tells a Chuck Norris Joke.\nroll: rolls a set of dice"},
{ "name": "Utility",
"value": "help: Displays a list of available commands, or detailed information for a specified command.\nprefix: Shows or sets the command prefix.\nping: Checks the bot's ping to the Discord server."}
]
}
}```
there @trim plinth
How Bot Ignore Channel/Serverss?
Mhm
if (message.guild.id === '') return;
if (message.channel.id === '') return;
something like that
I don't understand the request
Bot Can't Send Message On Server/Channel Like Muted
Still don't get it
?
@clear hill what error do you get in console
if you get Discord API Error: Missing Permissions then it doesn't have perms
then give your bot admin or higher perms
How I Make Like This /LoL xD?
how do you fix this? https://some.government-database.info/oR9Y09rf.png
i fixed this in VSC but then windows u[dates
replace :emoji: with <:emoji:id>
so :mmLol: would become 
does anyone know how to check if the bot has a permission in discord.js
hey guys how do you change the --default-search in youtube_dl to ytsearch
ok i'll try it
@restive silo is there any difference between hasPermission and permissions.has
i use hasPermission myself
why is no one looking at my questions
because maybe they dont know the answer
oh well that makes more sence
@austere meadow there isn't its more likely just an alias thing
ah okay
i'm using this if(!message.channel.guild.me.hasPermission("MANAGE_MESSAGES")) return message.channel.send("i don't have the manage messages permission and it's required for this command to function"); but it still doesn't work
if (!msg.member.permissions.has("MANAGE_MESSAGES")) return message.channel.send("i don't have the manage messages permission and it's required for this command to function");
No
does it only work with one guild or does it work with multiple?
it works with whatever guild object you have
Lib?
probably d.js
yes i'm using discord.js
if (!message.guilds.me.permissions.has("MANAGE_MESSAGES")) return message.channel.send("i don't have the manage messages permission and it's required for this command to function");
i copied your code but it still says missing permissions and the bot crashes
what is going wrong?
DiscordAPIError: Missing Permissions
Missing permissions means the bot doesn't have the permission to do the action you want it to do
understandable but it's supposed to say it instead of crashing
Why My Bot Uptime 0?
@real beacon Can your bot even speak in the channel?
i found out what's happening
i sent the code
Happy birthday kaniel.
thanks
Show code?
smh, JSON.stringify() it and ur good
jonasjac.
Yeah?
I know you I swear I have seen that name before/
You have lol
I have?
Yes
Where and who?
async run(message, args) {
const options = {
key: 'reeeee_dontstealmy_keeeeeey',
url: args.URL
}
goorl(options).catch(error => console.log(error));
const embed = new RichEmbed()
.setAuthor("FrenzyBot | URL Shortener", )
.setThumbnail(`https://i.imgur.com/gcmfoG1.png`)
.setColor(2876130)
.setFooter("<3 made with love", )
.setTimestamp()
.addField("Unshortened URL","[**"+args.URL+"**]("+args.URL+")", false)
.addField("Shortened URL", "[**" + goorl(options) + "**](goorl(options)", true)
message.reply({embed});
}
}
@quiet bobcat ^
is args.url a thing?

ye
class UrlShorten extends commando.Command {
constructor(client) {
super(client, {
name: 'shorturl',
group: 'useful',
memberName: 'shorturl',
description: 'Shortens a URL based using goo.gl',
args: [{
key: 'URL',
prompt: 'Please provide a link.',
type: 'string'
}]
});
}```
getting any errors?`
make sure you put module.exports = before class
yes
ye
weird
now im getting
at CommandoClient.emit (events.js:186:19)
at WebSocketConnection.onError (/Users/justinalexander/Desktop/frenzybot_dev/node_modules/discord.js/src/client/websocket/Web```

am i triggering you
im being stupid
right
ok i fixed that unhadled
handled
but
still no worky :/
๐
alright
i sorta got it to work
now what am i doing wrong
with these args
wait
i know
nvm
I should use the URL shortener I made
the infamous random.cat appears to be down
anything i'm not aware of or is it just gone for everyone too?
it's down
idk im not the guy who owns that site
i hope they can get the website back quick or else we will be searching for new cat apis for a long time
is that a good enough check for kick/ban commands? ๐ค
if member == ctx.author:
return await ctx.send(embed = discord.Embed(description = 'Sorry, but I can\'t let you do that! :sparkling_heart:', color = 0xFF0040))
elif ctx.author == ctx.guild.owner:
pass
elif ctx.author.top_role <= member.top_role:
return await ctx.send(embed = discord.Embed(description = 'I can not let you do that on members higher than, or equal to, you in role hierarchy.', color = 0xFF0000))
discord.py rewrite btw
yo, have you got some tutoriel (audio or video) for write, save and watch in json file ?
@ruby dust Yeah, as long as @commands.has_permissions(kick/ban_members = True) is above the function
I mean, I'm still not satisfied with the third check
it checks for the top role, but I'm sure there are some servers that gives users their required permissions not on the top role, but the below ones
what I would like is to check if the top role with specific permission is higher than member's top role, instead of just checking the top role
Hey, i'm stuck on how to assign users the 'Muted' role using a command in my server, what I have doesn't work but here it is anyway: (i'm using discord.py)
@commands.has_role('Administrator')
async def mute(ctx, user: discord.Member):
embed = discord.Embed(title='Mute Case:', description='{} Muted'.format(user.name), color=0xffee00)
embed.add_field(name='The Users Name is:', value='{}'.format(user.name), inline=True)
embed.add_field(name='The Users ID is:', value='{}'.format(user.id), inline=True)
embed.add_field(name='The Users Status is:', value='{}'.format(user.status), inline=True)
embed.add_field(name='The Users Highest Role is:', value='{}'.format(user.top_role), inline=True)
embed.add_field(name='The User Joined at:', value='{}'.format(user.joined_at), inline=True)
embed.set_thumbnail(url=user.avatar_url)
await bot.send_message(discord.Object(id='415979321857933313'), embed=embed)
bot.add_roles(user, 'Muted')```
1. you have to await the role adding part
2. you need to use discord.utils to find the role with that name
await bot.add_roles(user, role)```that would be the way if following your code
ok, ty ๐
could anyone DM the API url i need for up-votes stuff
BTW, that code didn't work....the error message was: discord.ext.commands.errors.CommandInvokeError: Command raised an exception: NameError: name 'guild' is not defined
@Override
public void action(String[] args, MessageReceivedEvent event)
throws FileNotFoundException, UnsupportedEncodingException {
String osuUsername = args[0];
if(osuUsername == null) {
event.getTextChannel().sendMessage("Usage: -osu <Username>").queue();;
}else{
Random r = new Random();
int i = r.nextInt(5);
System.out.println(r.nextInt(5));
if(i == 5) {
String url = "http://lemmmy.pw/osusig/sig.php?colour=hex66ccff&uname="+ osuUsername +"&onlineindicator=undefined&xpbar&xpbarhex";
event.getTextChannel().sendMessage(url).queue();;
} else if(i == 4) {
String url = "http://lemmmy.pw/osusig/sig.php?colour=hexee3333&uname=" + osuUsername +"&onlineindicator=undefined&xpbar&xpbarhex";
event.getTextChannel().sendMessage(url).queue();;
}else if(i == 3) {
String url = "http://lemmmy.pw/osusig/sig.php?colour=hexee8833&uname="+ osuUsername +"&onlineindicator=undefined&xpbar&xpbarhex";
event.getTextChannel().sendMessage(url).queue();;
}else if(i == 2) {
String url = "http://lemmmy.pw/osusig/sig.php?colour=hexaadd00&uname="+ osuUsername +"&onlineindicator=undefined&xpbar&xpbarhex";
event.getTextChannel().sendMessage(url).queue();;
}else if(i == 1) {
String url = "http://lemmmy.pw/osusig/sig.php?colour=pink&uname="+ osuUsername +"&onlineindicator=undefined&xpbar&xpbarhex";
event.getTextChannel().sendMessage(url).queue();;
}else if(i == 0) {
String url = "http://lemmmy.pw/osusig/sig.php?colour=hex8866ee&uname="+ osuUsername +"&onlineindicator=undefined&xpbar&xpbarhex";
event.getTextChannel().sendMessage(url).queue();;
}
}
}
Easyest Method for adding a osu Command to the JDA
@nimble merlin then do ctx.guild.roles instead
thank you! It's much appreciated ๐
np
OK, now it's just outputting: discord.ext.commands.errors.CommandInvokeError: Command raised an exception: AttributeError: 'Context' object has no attribute 'guild' ๐ฉ
0.16.12
I thought that might have been the issue
oh ok, ty
wait, i'm pretty sure that I already tried replacing guild with server and it didn't work...lemme try anyway
yea, annoyingly enough, it's outputting with: discord.ext.commands.errors.CommandInvokeError: Command raised an exception: AttributeError: 'Context' object has no attribute 'server' which makes no sense to me because I used ctx.server a few times before
in addition, I also have a problem warning for role=discord.utils.get(ctx.server.roles, name='Muted') because apparently role is an unused variable...
I have that below it
await bot.add_roles(user, 'Muted')```
Ohhhhhhhhhhhhhhhhhhh
I figured out the problem
God, I REALLY over think things
if you have role in the role adding part, it will do the whole discord.utils part for you since you have it defined
Discord's webhook ratelimit is different from send message ratelimits right?
it's the same message sending event as for any other account, isn't it? ๐ค
I thought webhook sending was separate
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: AttributeError: 'Context' object has no attribute 'server' I am still getting this message....
does async even has a context parameter? ๐ค
What version, async or rewrite
๐ค
@commands.has_role('Administrator')
async def mute(ctx, user: discord.Member):
embed = discord.Embed(title='Mute Case:', description='{} Muted'.format(user.name), color=0xffee00)
embed.add_field(name='The Users Name is:', value='{}'.format(user.name), inline=True)
embed.add_field(name='The Users ID is:', value='{}'.format(user.id), inline=True)
embed.add_field(name='The Users Status is:', value='{}'.format(user.status), inline=True)
embed.add_field(name='The Users Highest Role is:', value='{}'.format(user.top_role), inline=True)
embed.add_field(name='The User Joined at:', value='{}'.format(user.joined_at), inline=True)
embed.set_thumbnail(url=user.avatar_url)
await bot.send_message(discord.Object(id='415979321857933313'), embed=embed)
role = discord.utils.get(ctx.server.roles, name='Muted')
await bot.add_roles(user, role)``` That's what I have, but it doesn't work lol
oh!
try server.roles ๐ค
ctx.message.server
ok
oh yeah?
so which do I try???? lol
Mine
ok
so isn't it suppose to be ctx.message.server.roles? since he is trying to find a role in the server ๐ค
yes
It worked....after around 50 different attempts (that was hours before I asked anyone lol) ๐
And the unmute command even works too, bonus ๐
I did....I didn't get a responce though
ask again, sometimes people don't respond
Don't need to, I did it...
or they might call you dumb, but you eventually figure out what's wrong
Emphasis on eventually but your right
If you need any more help ping me(just not all the time, do try to solve on your own)
OK, thank you, and I won't spam you lol ๐
I never ask in dapi anymore, they are either useless or too triggering
ik
they've just got a bit of a superiority complex going on
agreed
well, I better get my maths homework done (yes, brits say maths if you didn't know)
what does everyone use to code there bots? which bot is yours? ๐
I use vs code
your bot is in here?
Yes, @smoky plinth
intellij
all i wanna know is
how do people do sick stuff like those images with the welcome message
REEEE
ima do it
just being retarded
they use libs to generate images
but that uses quite a bit of cpu
python im triggered
be triggered, python is bae
fair enough
well depends on your language but most common are Canvas/Jimp for JS and Pillow/Wand for py (i dont know image manipulation libs for other langs)
Someone know if I can use remplace
But not for only 1 string
welcome.message.replace(/USER/g, member.mention) like here for example that change USER by the member.mention. If I want to add COUNT that change by something else
How I do ?
i'm using Magick.NET for .NET Core
oil, if you're talking about what i think you're talking about... you could do two things:
A) just keep repeating the replace call on the same line, welcome.message.replace(/USER/g, member.mention).replace(/COUNT/g, ...)
B) or you could create an object with keys that represent the name of some replacement, like:
const replacements = {
"USER": member.mention,
"COUNT": ...
};
welcome.message.replace(/<(\w+)>/g, (match, capture) => replacements[capture]);
if i'm not mistaken that should work
wait, hold on
let me change that
i've changed it so that it will replace <USER>, rather than USER, which previously was a bit ambiguous in the case if a user wished to use "USER" in their message
likewise, <COUNT>
Why doesn't this work? If this entire code is just nonsense don't judge me, this is my first attempt at a role command...
It's in js
thanks
Thanks
@high tinsel you need to pass a roleresolvable to addrole so i dont think a stribg will work
probs have to do like membee.guild.roles... find by name if doesnt exist creatr it
Isn't there any way that it would work this easily (like replacing that string with something else)?
I edited that int problem and it still doesn't work :(
And I tried a lot of variations of this code... None of them worked...
You mean instead of var role use console.log role?
hey i'm new
console.log it to see it its not undefined
I think he means like
console.log(role);
to see what it outputs in the console
yes
@high tinsel Have you tried:
message.content.includes("--addrole")
wow i overlooked that when giving a suggestion before lmao... yeeeaa you should probs fix that ^ @high tinsel
const client = new Discord.Client();
DBLPoster.bind(client);
RangeError: You need to provide a client to bind to!
legit
https://www.npmjs.com/package/dblapi.js use the official library
can anyone help me out with google's custom search api?
how do I do to create a command that looks for stuff on a certain site that I put in command?
how to make bot never crash Discord.js?
HOW?
npm package
pm2 is a npm package, search it up
WHERE?
and?
just use forever.js tbh
eh I prefer pm2
forever.js?
both do the same thing
npm install pm2?
yep
pm2 start __.js?
yes
you can also name the process
like pm2 start __.js --name mything but you can't have spaces in the name
yeah thats pretty much all the basics
[PM2] Spawning PM2 daemon with pm2_home=C:\Users\user.pm2
[PM2] PM2 Successfully daemonized
[PM2] Starting C:\Users\user*****__.js in fork_mode (1 instance)
[PM2] Done.
pm2 show <id|name>?
yeah so if it is running it should be online
if it is stopped that means there was an error
you can always do pm2 monit if you want to view the console
- you can do
pm2 logsas well
when bot crsh aaaaaaaaaaaaaaaaaaauto restart?
yes
@wise bloom
@raw wharf has it been approved?
@trim plinth How I Use DBL?
post in bugs then, must be a bug because it shouldn't do that
@snarkyfetch How I Use DBL?
okay
How I Use DBLapi?
Read the docs
Done . Because It Dint Work!
did you do it correctly
ye
show code
If it doesn't work then no, you did not do it correctly
oof
const client = new Discord.Client();
const DBL = require("dblapi.js");
const dbl = new DBL(`<secret> `, client);
client.on('ready', () => {
setInterval(() => {
dbl.postStats(client.guilds.size, client.shards.Id, client.shards.total);
}, 1800000);
});```
looks good, now just post your token and you'll be even better
@clear hill does your bot have shards
jk jk pls no ban
how do you not know if your bot doesn't have shards 
@trim plinth is yours sharded?
no my bot doesn't have shards, you should only start having shards by 1K guilds
The more shards the more memory Discord will hog
?
oml
LOL
FORGET
somebody could've copied that so I suggest regening the token like rn




