#development

1 messages ยท Page 381 of 1

high tinsel
#

Thank you this seems to be working!

unborn oracle
#

np

high tinsel
#

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 ๐Ÿ˜ƒ

royal mantle
#

o.o

earnest phoenix
#

how do u use guildEmojisUpdate in discord.js?

earnest phoenix
#

anyone :/

unborn oracle
#

I don't believe guildEmojiUpdate is a thing d.js

earnest phoenix
#

!serverinfo

uncut slate
earnest phoenix
#

?serverinfo

trim plinth
#

#commands for bot commands. They won't reply here.

languid dragon
karmic parcel
trim plinth
#

got muted GWchadThinkeyes

#

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 GWjustinPepeCry

languid dragon
#

show code and errors?

inner jewel
#

does the bot have embed perms?

languid dragon
#

that was my next question yes

trim plinth
#

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 ![GWchadThonkery](https://cdn.discordapp.com/emojis/366999788803325952.webp?size=128 "GWchadThonkery")
#

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

earnest phoenix
#
message.channel.send({noU});
#

Try that

languid dragon
#
return message.channel.send({
    embed:{
        color: 0x007acc,
        description: "Some description here",
        author:{
            name: "Author name",
            url: "some url",
            icon_url: "some url"
        }
    }
})
earnest phoenix
#

That would work too

trim plinth
#

I tried that as well, didn't help

languid dragon
#

@river compass

earnest phoenix
#

Well I usually call the variable embed and do message.channel.send({embed});

#

that works for me at least

inner jewel
#

{x} is the same as {x: x}

#

so for {embed} to work it must be called embed

earnest phoenix
#

Yeah, I said that I call it embed

languid dragon
trim plinth
#

it has to be called embed GWjustinTurtleThink

#

lemme try that

#
const infoEmbed = new Discord.RichEmbed()
                         ^
ReferenceError: Discord is not defined```
inner jewel
#

const Discord = require("discord.js")

trim plinth
#

I required it lmao

languid dragon
#

in the same file?

trim plinth
#

yep

earnest phoenix
inner jewel
#

const {RichEmbed} = require("discord.js")

languid dragon
#

dont use builders, its so much easier going raw ok

inner jewel
#

builders are better if the embed will have a different layout based on runtime information

trim plinth
#

Even when I use raw, it still returns the error GWfroggyBlobSweat

inner jewel
#

eg a field will only be there if x is 1

topaz fjord
#

Ew raw

inner jewel
#

if(x === 1) {
builder.addField(...)
}

languid dragon
trim plinth
#

I used that before

#

Again, even using Raw didn't change the error GWnanamiAwokenSock

languid dragon
#

show more code?

inner jewel
#

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") } }

trim plinth
#

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);
languid dragon
#

and the error is that Discord is not defined?

trim plinth
#

yup

languid dragon
#

show the full code then

trim plinth
#

mk

night imp
#

Hey, could anyone point me into the direction for making custom images with node.js? Such as this

restive silo
#

Canvas

#

or jimp

night imp
#

Ok thank you

languid dragon
#

canvas best

restive silo
#

ye

night imp
#

I will check it out

#

๐Ÿ™‚

restive silo
topaz fjord
#

Although canvas is a pain in the ass to install on windoes

trim plinth
#
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

earnest phoenix
#

put it outside of the exports.run function

inner jewel
#

it shouldn't matter

earnest phoenix
#

oh

#

nvm then

trim plinth
#

Putting it outside would cause the message to not send

topaz fjord
#

@trim plinth wuts error?

trim plinth
#

"Discord isn't defined" GWnanamiAwokenSock

topaz fjord
#

Wut the fuck

trim plinth
#

yeah it's weird

#

I can't tell if this is an issue with the lib or me

earnest phoenix
#

I usually put the Discord declaration outside of the command function, I don't know if that would affect it or not

trim plinth
#

That wouldn't change anything

#

All that would do is take it out of the variable imports

earnest phoenix
#

I don't know what to suggest then, unless maybe reinstalling discord.js

trim plinth
#

I tried that already

earnest phoenix
#

Weird

trim plinth
#

If there isn't a solution or problem in the code I'll just have to hit up the discord.js Discord

thin rivet
#

!eval

#

wait

trim plinth
ruby gazelle
#

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
}
}
});```

gilded blaze
#

error?

ruby gazelle
#

yes

hushed berry
#

what is if (member.guild.id != `${message.guild.id}`) return; supposed to do

elder rapids
#

That gives me an impression that event is connected under a message handler event

#

aaaaa

hushed berry
#

oh sorry

#

i misread that

ruby gazelle
#

I did not know why they are new so I saw some videos on youtube and docs from discord.js

gilded blaze
#

Can you show the error?

ruby gazelle
#

of course an instant

quiet bobcat
#

What are you trying to achieve with that line?

inner jewel
#

you cut off the whole error message

ruby gazelle
#

I do not know exactly

inner jewel
#

because message is undefined

#

that's what the error was saying

gilded blaze
#

yes

ruby gazelle
#

Thank you for the help.

hushed berry
#

so its just being put into a template literal and just made into a string again?

topaz fjord
#

@ruby gazelle still need help

#

?

#

Oh wait

#

Nvm

trim plinth
ruby gazelle
#

I need no thank you

vital lark
#

@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

trim plinth
earnest phoenix
#

whats the url it sent?

vital lark
#

ยฏ_(ใƒ„)_/ยฏ

#

it justs rans the command error when you do {prefix}neko

trim plinth
#

runs*

#

grammer plz!!

visual surge
#

dude, it's actually grammar
๐Ÿ˜‰ @trim plinth

trim plinth
#

dude, it's actually called I was being sarcastic
GWfroggyWeSmart @visual surge

visual surge
#

(oh alright good...)

#

I didn't .catch() onto that

earnest phoenix
#

how long does it take to stop pending

#

fine den go offline

topaz fjord
#

@earnest phoenix once a mod approves

earnest phoenix
#

how long does that take?

topaz fjord
#

1 hour to a week

earnest phoenix
#

oof

topaz fjord
#

asking a mod delays the process

earnest phoenix
#

rip

#

its also not a verified bot

#

so what if they review it when itd offline

topaz fjord
earnest phoenix
#

;-;

topaz fjord
#

@earnest phoenix any bot that is offline while they are reviewing gets denied

earnest phoenix
#

shit

topaz fjord
#

must have 24/7 hosting

earnest phoenix
#

isnt that verified bot?

#

not ncessarily 24/7

#

yh

topaz fjord
#

ish ish

earnest phoenix
#

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

wooden shoal
#

LMFAO

#

Ur fuckin name and avatar

#

I'm dying lmao

fickle hawk
#

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'
inner jewel
#

try activity

fickle hawk
#

I was thinking it was something simple and i was just being dumb -.-

#

Thanks for the help though!

tiny turtle
#

this is the outcome

inner jewel
#

no code
"hi what's wrong?"

tiny turtle
#

^hastebin

inner jewel
#

that's just json

tiny turtle
#

^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?

topaz fjord
#

@tiny turtle you have to show actual code not Json and a picture

tiny turtle
#

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

topaz fjord
#

Omfg

tiny turtle
#

all my code looks like that lol

topaz fjord
#

How are you sending an embed with a Json file then

tiny turtle
#

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" },

topaz fjord
#

But what are you using to actually send the message

#

Like send it to the channel

tiny turtle
#
{
      "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

vital lark
#

@tiny turtle UHHHH

#

what are you doing?

tiny turtle
vital lark
#

doesn't look like a embed to me

topaz fjord
#

How is he sending an embed with json

#

Like sending it to the discord channel

#

What lib are you using?

vital lark
#
msg.channel.send('', {
    embed: {
        // embed content
    }
});
``` this is how to make a embed with JSON
tiny turtle
#

all my comands, like all look like that

vital lark
topaz fjord
#

@tiny turtle what library and language

vital lark
#

json commands

#

kek

tiny turtle
#

the bots in here, the only issue I am having is in the screen shot

#

one command wont pull the values

topaz fjord
#

What library and language are you using

tiny turtle
#

um node and javascript and obviously json

topaz fjord
#

Show the JavaScript code then

tiny turtle
#

there is none for this command and there is at the same time if youd click the link lol

topaz fjord
#

I did

#

But Json is not what I need

#

I need JavaScript code to help

tiny turtle
#

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?

pale light
#

200 no

topaz fjord
#

honestly im fucking lost

#

@pale light gimme squishy cat

pale light
topaz fjord
#

i need

tiny turtle
#

400 is no, 200 is ok i thought

pale light
#

I'm lost now too

unique star
#

it literally says success false lol

topaz fjord
#

lmao

tiny turtle
#

also says error null

#

200 success

topaz fjord
#

does the callback for the url give back 2 params?

tiny turtle
#

yea

unique star
#

I wouldn't rely too much on html status codes I have seen apis return 200 with errors

tiny turtle
#

I used data mine to get the xpath

topaz fjord
#

datamine?

tiny turtle
#

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

lone magnet
#

hi sir..

#

how i can put my .jar file to bot?

tiny turtle
lone magnet
#

my bad sir.. im new bot developer

#

my bot is still waiting for approval

earnest phoenix
#

wait huh json commands?

sinful chasm
#

pyra_ ?

frail kestrel
#

yes kyle

olive ridge
#

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

heady zinc
#

your bot may not have the permission to upload files in this channel/server

olive ridge
#

wait no

#

i replaced the link

#

and it works again

topaz fjord
#
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

olive ridge
#

ook

#

i thought u had an error therre lol

#

thx for spoon feed senpai

topaz fjord
#

technically not spoonfeed

#

just a tip

olive ridge
#

spoon feed me senpai

trim plinth
olive ridge
#

moar

vital lark
#

no u

rain tulip
#

is there a js thing for

#
"1
2
3"
#

would be converted to

#
"1"
"2"
"3"
lethal sun
#

use \n

rain tulip
#

Yes, but how do i do so if i dont want to manually input it

frail kestrel
#

???

jagged birch
#

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?
quiet bobcat
#

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

jagged birch
#

works for me..

msg.guild.createChannel("test", "voice");```
@quiet bobcat
quiet bobcat
#

weird

jagged birch
#

works for me, maybe you need " instead of '

quiet bobcat
#

Shouldn't do any differance because they are both strings. But I can try

jagged birch
#

Yeah, idk.

quiet bobcat
#

Same thing :/

jagged birch
#

yeah that's weird i dont know then

#

works for me

quiet bobcat
#

Ok, thanks for your help

jagged birch
#

np

uncut slate
#

@quiet bobcat make sure you're using the docs for the version you're using

quiet bobcat
#

I am using the docs for my version

frail kestrel
#

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])

quiet bobcat
#

I'm using master though

frail kestrel
#

type being a string and can be text, voice or category

#

oh

quiet bobcat
#

wait

#

it changed from master to stable GWchadThinkeyes

#

createChannel isn't in the docs on master

#

huh

#

weird

heady zinc
#

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 ZoomEyes

#

@quiet bobcat

quiet bobcat
#

oh

#

I'm blind

#

thanks

bitter sundial
#

guild.channels.create does make sense

quiet bobcat
#

Yeah

heady zinc
#

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 ZoomEyes

bitter sundial
#

well now they do

lethal sun
#

How can I delete a certain row in sqlite3? GWcodesJs

heady zinc
#

indeed

#

or well "now"

#

v12 release when kappalul

lethal sun
#

v13 is out if ur talkong about d.js

heady zinc
#

no its not ZoomEyes

lethal sun
#

um

#

weird

#

lemme kill my Chrome

#

brb

#

cookies broke on my chrome

frail kestrel
#

no

#

thats 1.3

austere flare
#

I am looking for a person who can create an order for my bot which is already created but nothing

swift tusk
#

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)

mental willow
#

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

slim solar
#

Who can help me with my discord.Js in french please ?

abstract mango
#

@mental willow are you even using python3

fickle hawk
#

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
ruby dust
#

@fickle hawk you don't have self defined, since you have it in your code it doesn't know what to do with it

fickle hawk
#

self.bot = bot

ruby dust
#

try this async def on_guild_join(self, guild)

fickle hawk
#

inconsistent use of tabs and space in indentation

hushed oyster
#

wait

#

nvm

fickle hawk
#

xd

abstract mango
#

that means you are using tabs AND spaces

#

don't do that

ruby dust
#

oh, you literally just copied my code over yours xd, put : at the end of my code

fickle hawk
#

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 ;-;

abstract mango
#

then you aren't using only tabs

fickle hawk
gilded blaze
ripe blade
#

oof code sprints are tiring

slim solar
#
(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)
lethal sun
#

How can I delete a certain row in sqlite3? Node.JS

earnest phoenix
#

delete query

ripe blade
#

DELETE * FROM table WHERE rowparam='yourthang'

earnest phoenix
#

drop tables bloblul

frank cosmos
#

i need some help with php

#

can anyone help?

uncut slate
#

just ask your question

frank cosmos
#

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

brisk notch
#

what is this?

frank cosmos
#

an api

#

@brisk notch

safe idol
#

!joinserver

south finch
#

hmmm testing

bright karma
#

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

steel quail
#

is there anyone that knows their way around python3?

rain tulip
#

hm

steel quail
#

can i pm you?

bright karma
#

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?

elder rapids
#

Only changes after 1,000 successfull logins to the websocket in 24 hour period

ruby dust
#

iirc, refreshing the page also regenerates it, so by opening the page again it will generate a new one

inner jewel
#

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

elder rapids
#

^

ruby dust
#

well when I opened my bot's page, my bot stopped working ๐Ÿค”

inner jewel
#

unrelated

#

unless you clicked the reset button

ruby dust
#

I did not

elder rapids
#

You probably did

ruby dust
#

._.

#

it's pointless to argue with you, so ima go while I still can

elder rapids
#

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

bright karma
#

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

inner jewel
#

"This token changes on page refresh and is valid unless manually regenerated below."

abstract mango
#

@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

bright karma
#

ok thanks

abstract mango
#

np

uncut slate
#

btw, the 2nd part of your token is safe to flash too :b

inner jewel
#

^

#

first and second mean close to nothing

#

first is used to know who did the action, second idk, third is the authentication

bitter sundial
#

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

bleak sapphire
#

anyone knows how to set config vars in heroku with python and github
bot.run(BOT_TOKEN) doesnt seem to work

inner jewel
#

3rd is HMAC, 2nd is token generation timestamp @bitter sundial

bitter sundial
#

oh interesting

#

how's it encoded

inner jewel
#

b64 of the raw timestamp bytes

#

uint64 -> 8 bytes -> b64

trim plinth
inner jewel
trim plinth
bitter sundial
#

someone already made a freaking image of it

#

wow

#

thanks for that

idle grail
#

MzA4MjkzNjAzNTMxMjkyNjcy.DN9r_A.brcD2xRAqjAGTuMcGPwy4TWVQdg Got it

elder rapids
river dawn
#

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

austere meadow
#

@river dawn what does {} mean? optional or required?

river dawn
#

It's just a way to seperate the title from the options

austere meadow
#

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

river dawn
#

Oooh

#

I'll see if strawpoll allows no title

austere meadow
#

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"

river dawn
#

Oh ya

#

Ok thank you

austere meadow
#

no problem blobthumbsup

river dawn
#

โค

tiny turtle
#

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!

pine rune
#

p!daily

trim plinth
pine rune
#

๐Ÿ‘

jagged birch
#

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 ๐Ÿค”

solemn obsidian
#

get the information of the link -> has song length

jagged birch
#

o ye ty

earnest phoenix
#

someone explain pls

gusty topaz
earnest phoenix
#

i have that as my description

gusty topaz
#

pls

earnest phoenix
#

and it dont work

gusty topaz
#

this makes the website experience 100 times worse

earnest phoenix
#

wait wut am confused

#

whats that

#

that on mine?

gusty topaz
#

in the iframe

#

that url in the source

#

I went to it

#

and got this shite

earnest phoenix
#

o yeah

#

its an adblocker

#

WAit

#

that might be why

gusty topaz
#

well

earnest phoenix
#

lemmie remove it from that page

gusty topaz
#

yes

#

that antiadblock stuff is so annoying

#

and makes me just block more antiadblock script

#

than anything

earnest phoenix
#

yeah ok removed

#

but iframe sitll dont work

#

da fuq

gusty topaz
#

Have you set frame width and height

earnest phoenix
#

ok

#

nope

#

mhm

#

this is confusing

#

hey @bitter sundial

#

u know why?

bitter sundial
#

?

earnest phoenix
#

its just a white page

#

when i try embed my website page

bitter sundial
earnest phoenix
#

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?

mighty haven
#

@gilded plank

earnest phoenix
#

?

mighty haven
#

nothing

#

you have a bot>

#

?????

earnest phoenix
#

yooo @bitter sundial i dont understand why its not working by default X-Frame_options is set to sameorigins

#

and yes

mighty haven
#

i have to

earnest phoenix
#

mk

mighty haven
#

itz one command

earnest phoenix
#

Noice

#

i has them

raw wharf
#

if my bot was accepted, because it does not appear on this server?

ruby dust
#

-bots @raw wharf

gilded plankBOT
#
BulzyKrown#2400
Bots

@wise bloom

ruby dust
#

eh

#

maybe it's being added

raw wharf
#

when they accepted it they added it to another server [not where they test the bots]

ruby dust
#

I see it's still not verified in the other listing site

#

same for me

#

xd

raw wharf
#

xd

quiet bobcat
#

I'm wondering if someone could do html and css for a friend of mine. He'll pay $5 for it

olive ridge
#

For a bot?

quiet bobcat
#

It's a dashboard

#

So, yes

olive ridge
#

It would probaly be mush better to use a different language

#

Than

#

HTML and CSS

elder rapids
#

um. it's a website

olive ridge
#

oh

#

i thought discord bot

elder rapids
#

๐Ÿ˜‚

quiet bobcat
#

๐Ÿ˜‚

olive ridge
#

Don't they have free ones online?

quiet bobcat
earnest phoenix
#

why use bother with complex html and css when you can just have your entire website be java based with the browser plugin

olive ridge
#

^

elder rapids
#

=> Why bother with that (and require java download and plugin permission) when you can just make it with Unity and do a web player

olive ridge
#

why not just learn to code

#

lifeskill

earnest phoenix
#

entire website in markdown

quiet bobcat
#

@olive ridge he knows some html and css, he just doesn't have the time to make an entire dashboard for himself

olive ridge
#

what does he need it for?

quiet bobcat
#

His bot

olive ridge
#

is it a hobby project?

quiet bobcat
#

He has a bot and he wants an online dashboard so that you can control it online. Call it whatever you want

olive ridge
#

No like

#

Is it for a job?

#

or is he doing it for fun?

quiet bobcat
#

Doing it for fun

olive ridge
#

Then wouldn't point of it to be to code it from scrath

quiet bobcat
#

ยฏ_(ใƒ„)_/ยฏ

#

Not my dashboard

olive ridge
#

at this point

#

you might as well just hire a professional to do it

#

then us skrubs'

#

or actualy code it your self

fickle hawk
#

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
earnest phoenix
#

those spaces shouldn't be there

#

@fickle hawk

fickle hawk
#

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? Thonk

earnest phoenix
#

it should be fine now

#

are you sure you're not mixing tabs with spaces?

fickle hawk
#

I played around with it a bit and I got it to run

#

but

#

it didnt post anything to the api

earnest phoenix
#

add some debugging

feral storm
#

anyone here use Discord Bot Maker? #NoHatePlease

ruby dust
#

real bot devs make bots the real way

#

xd

#

I honestly need to google what this discord bot maker thing even is

trim plinth
#

DBM can be used for bot making its just really shitty compared to making a bot from scratch

ruby dust
#

I can imagine, literally everything that is made to make something without proper knowledge will never have enough possibilities

trim plinth
#

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 GWchadThonkery

ruby dust
#

I'd say it's pretty obvious: either be lazy and pay, or work your way to make something yourself for free

fickle hawk
#

@earnest phoenix I got a 403: Forbidden error while trying to post server count

quasi marsh
#

Mistake in your token or bot id?

unborn stone
#

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.
quasi marsh
#

Most libs should have waiting for messages

unborn stone
#

What do you mean? I'm using Discord.js

#

I want to be able to post the responses in a channel.

#

@quasi marsh ^

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

unborn stone
#

I don't know how though.

quasi marsh
#

Should be able to get the channel from the message quite easily

#

Me neither because I don't use JS

unborn stone
#

That's why I'm asking...

quasi marsh
#

I think you can use a MessageCollector

#

Not sure tho

earnest phoenix
#

Can anyone figure out why my bot, @nocturne mist has no game status? It is coded in python. DM me for the pics

trim plinth
#

you can just post them in chat Thonk

earnest phoenix
#

its a lot of pics

#

tho

trim plinth
#

yeah but it would be making solving the problem faster if you were to just post them in chat instead of DMing them

earnest phoenix
#

kk

#

just gonna post github link

cunning oxide
#

what r the icons everyone uses in their richembeds?

old badge
#

icons?

#

which ones?

cunning oxide
#

idk

#

like is there a good place to just find icons

#

to use in my richembeds

old badge
#

do you mean the image, thumbnail or the author/footer icons?

cunning oxide
#

nah i got it

#

thanks tho โค

trim plinth
cunning oxide
#

any help?

trim plinth
#

show code

cunning oxide
#

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

clear hill
#

How Bot Ignore Channel/Serverss?

hushed oyster
#

@clear hill what lib?

#

well

#

if you don't answer me

#

I can't help

clear hill
#

DISCORD.JS

#

``

west current
#

Mhm

old badge
#
if (message.guild.id === '') return;

if (message.channel.id === '') return;

something like that

west current
#

I don't understand the request

clear hill
#

Bot Can't Send Message On Server/Channel Like Muted

west current
#

Still don't get it

clear hill
#

?

old badge
#

@clear hill what error do you get in console

#

if you get Discord API Error: Missing Permissions then it doesn't have perms

clear hill
#

Missing Permissions

#

YEP

old badge
#

then give your bot admin or higher perms

clear hill
#

oh

#

thx

clear hill
#

How I Make Like This /LoL xD?

old badge
#

?

#

๐Ÿ‘€

brisk notch
#

i fixed this in VSC but then windows u[dates

hushed oyster
#

replace :emoji: with <:emoji:id>

#

so :mmLol: would become ![mmLol](https://cdn.discordapp.com/emojis/356831697385422848.webp?size=128 "mmLol")

real beacon
#

does anyone know how to check if the bot has a permission in discord.js

mental willow
#

hey guys how do you change the --default-search in youtube_dl to ytsearch

restive silo
#

<Guild>.me.hasPermission() or <Guild>.me.permissions.has()

#

@real beacon

real beacon
#

ok i'll try it

austere meadow
#

@restive silo is there any difference between hasPermission and permissions.has

#

i use hasPermission myself

mental willow
#

why is no one looking at my questions

languid dragon
#

because maybe they dont know the answer

mental willow
#

oh well that makes more sence

restive silo
#

@austere meadow there isn't its more likely just an alias thing

austere meadow
#

ah okay

real beacon
#

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

clear hill
#

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");

real beacon
#

trying to check if the bot has a permission

#

is it possible?

clear hill
#

No

tawny lava
#

yes it is

#

<Guild>.me.permissions.has("MANAGE_MESSAGES")

real beacon
#

does it only work with one guild or does it work with multiple?

tawny lava
#

it works with whatever guild object you have

clear hill
#

Lib?

tawny lava
#

probably d.js

real beacon
#

yes i'm using discord.js

clear hill
#

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");

tawny lava
#

message.guild

#

not guilds

clear hill
#

...

#

K

real beacon
#

i copied your code but it still says missing permissions and the bot crashes

#

what is going wrong?

#

DiscordAPIError: Missing Permissions

topaz fjord
#

Missing permissions means the bot doesn't have the permission to do the action you want it to do

real beacon
#

understandable but it's supposed to say it instead of crashing

clear hill
#

Why My Bot Uptime 0?

hushed oyster
#

@real beacon Can your bot even speak in the channel?

real beacon
#

i found out what's happening

cunning oxide
#

@hushed oyster happy birthday btw

hushed oyster
#

@cunning oxide What is the command's code?

#

thanks

cunning oxide
#

i sent the code

hushed oyster
#

oh

#

d.js

#

i'm not good with that

cunning oxide
#

reeee

#

ok

#

just not sure why its being so wack

earnest phoenix
#

Happy birthday kaniel.

hushed oyster
#

thanks

earnest phoenix
#

np ๐Ÿ˜ƒ

#

Oh also I can help you freejstnadlxndr

#

discord.js right?

quiet bobcat
#

Show code?

heady zinc
#

smh, JSON.stringify() it and ur good

earnest phoenix
#

jonasjac.

quiet bobcat
#

Yeah?

earnest phoenix
#

I know you I swear I have seen that name before/

quiet bobcat
#

You have lol

earnest phoenix
#

I have?

quiet bobcat
#

Yes

earnest phoenix
#

Where and who?

cunning oxide
#
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 ^

quiet bobcat
#

is args.url a thing?

cunning oxide
#

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'
            }]
        });
    }```
quiet bobcat
#

getting any errors?`

cunning oxide
#

nah

#

just

quiet bobcat
#

oh

#

commando

#

uhhh

gusty topaz
#

make sure you put module.exports = before class

cunning oxide
#

module.exports = class UrlShorten extends commando.Command

#

like that right

gusty topaz
#

yes

cunning oxide
#

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```
gusty topaz
cunning oxide
#

am i triggering you

#

im being stupid

#

right

#

ok i fixed that unhadled

#

handled

#

but

#

still no worky :/

gusty topaz
#

I mean

#

commando is shit

#

and I am abandoning it soon

cunning oxide
#

word

#

you reccomend just writing framework myself/

#

?

gusty topaz
#

I mean

#

Parsing commands isnt that difficult

cunning oxide
#

word

#

wait

#

i am being stupid

pale light
#

๐Ÿ†—

cunning oxide
#

alright

#

i sorta got it to work

#

now what am i doing wrong

#

with these args

#

wait

#

i know

#

nvm

karmic parcel
#

I should use the URL shortener I made

cunning oxide
#

wh

#

fixed it

frigid sierra
#

the infamous random.cat appears to be down

#

anything i'm not aware of or is it just gone for everyone too?

uncut slate
#

it's down

gusty topaz
#

like

#

they deleted everything

#

off the website

real beacon
#

yeah now my cat command wont work

#

what happened bring it back

gusty topaz
#

idk im not the guy who owns that site

real beacon
#

i hope they can get the website back quick or else we will be searching for new cat apis for a long time

ruby dust
#

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))
earnest phoenix
#

yo, have you got some tutoriel (audio or video) for write, save and watch in json file ?

hushed oyster
#

@ruby dust Yeah, as long as @commands.has_permissions(kick/ban_members = True) is above the function

ruby dust
#

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

nimble merlin
#

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')```
ruby dust
#

1. you have to await the role adding part
2. you need to use discord.utils to find the role with that name

nimble merlin
#

ok, ty

#

where exactly should I add the discord.utils (i'm a noob....believe me)

ruby dust
#
await bot.add_roles(user, role)```that would be the way if following your code
nimble merlin
#

ok, ty ๐Ÿ˜ƒ

feral storm
#

could anyone DM the API url i need for up-votes stuff

nimble merlin
#

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

onyx pebble
#
@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

ruby dust
#

@nimble merlin then do ctx.guild.roles instead

abstract mango
#

@nimble merlin it would be ctx.guild instead of guild for you

#

ye

nimble merlin
#

thank you! It's much appreciated ๐Ÿ˜ƒ

abstract mango
#

np

nimble merlin
#

OK, now it's just outputting: discord.ext.commands.errors.CommandInvokeError: Command raised an exception: AttributeError: 'Context' object has no attribute 'guild' ๐Ÿ˜ฉ

abstract mango
#

wait which d.py version are you on

nimble merlin
#

0.16.12

abstract mango
#

ah

#

you'd use server instead of guild then

nimble merlin
#

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...

abstract mango
#

await bot.add_roles(user, role)

#

:p

nimble merlin
#

I have that below it

#
    await bot.add_roles(user, 'Muted')```
#

Ohhhhhhhhhhhhhhhhhhh

#

I figured out the problem

#

God, I REALLY over think things

ruby dust
#

if you have role in the role adding part, it will do the whole discord.utils part for you since you have it defined

oblique sequoia
#

Discord's webhook ratelimit is different from send message ratelimits right?

ruby dust
#

it's the same message sending event as for any other account, isn't it? ๐Ÿค”

oblique sequoia
#

I thought webhook sending was separate

nimble merlin
#

discord.ext.commands.errors.CommandInvokeError: Command raised an exception: AttributeError: 'Context' object has no attribute 'server' I am still getting this message....

ruby dust
#

does async even has a context parameter? ๐Ÿค”

nimble merlin
#

yes

#

I use it in EVERY command

oblique sequoia
#

What version, async or rewrite

nimble merlin
#

async

#

0.16.12 to be exact

oblique sequoia
#

๐Ÿค”

nimble merlin
#
@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
oblique sequoia
#

oh!

ruby dust
#

try server.roles ๐Ÿค”

oblique sequoia
#

ctx.message.server

nimble merlin
#

ok

ruby dust
#

oh yeah?

oblique sequoia
#

ctx doesn't have server in async

#

it does in rewrite as ctx.guild though

nimble merlin
#

so which do I try???? lol

oblique sequoia
#

Mine

nimble merlin
#

ok

ruby dust
#

so isn't it suppose to be ctx.message.server.roles? since he is trying to find a role in the server ๐Ÿค”

oblique sequoia
#

yes

nimble merlin
#

It worked....after around 50 different attempts (that was hours before I asked anyone lol) ๐Ÿ˜„

#

And the unmute command even works too, bonus ๐Ÿ˜„

oblique sequoia
#

Why didn't you ask for help in d.py thonk

nimble merlin
#

I did....I didn't get a responce though

oblique sequoia
#

ask again, sometimes people don't respond

nimble merlin
#

Don't need to, I did it...

oblique sequoia
#

or they might call you dumb, but you eventually figure out what's wrong

nimble merlin
#

Emphasis on eventually but your right

oblique sequoia
#

If you need any more help ping me(just not all the time, do try to solve on your own)

nimble merlin
#

OK, thank you, and I won't spam you lol ๐Ÿ˜„

ruby dust
#

I never ask in dapi anymore, they are either useless or too triggering

nimble merlin
#

ik

oblique sequoia
#

they've just got a bit of a superiority complex going on

nimble merlin
#

agreed

#

well, I better get my maths homework done (yes, brits say maths if you didn't know)

feral storm
#

what does everyone use to code there bots? which bot is yours? ๐Ÿ˜ƒ

quiet bobcat
#

I use vs code

feral storm
#

your bot is in here?

quiet bobcat
#

Yes, @smoky plinth

inner jewel
#

intellij

cunning oxide
#

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

inner jewel
#

they use libs to generate images

cunning oxide
#

๐Ÿค”

#

ight

inner jewel
#

but that uses quite a bit of cpu

quasi marsh
cunning oxide
#

python im triggered

oblique sequoia
#

be triggered, python is bae

cunning oxide
#

fair enough

restive silo
#

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)

earnest phoenix
#

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 ?

frigid sierra
quasi marsh
#

I'm implemented Pillow in my private server bot

#

Fun stuff

frigid sierra
#

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>

earnest phoenix
#

@frigid sierra Thanks you

#

@quasi marsh What is Pillow ?

quasi marsh
#

A PIL fork

#

Image lib for python

high tinsel
#

It's in js

ruby gazelle
#

how to make the bot add emoji in its own message

#

??

inner jewel
#

member.addRole

#

not AddRole

ruby gazelle
#

thanks

high tinsel
#

Thanks

earnest phoenix
#

@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

high tinsel
#

Isn't there any way that it would work this easily (like replacing that string with something else)?

earnest phoenix
#

--addrole --addrole

#

free exception

high tinsel
#

And I tried a lot of variations of this code... None of them worked...

topaz fjord
#

did you try console.log role

#

@high tinsel

high tinsel
#

You mean instead of var role use console.log role?

topaz fjord
#

no

#

after you define role

terse saddle
#

hey i'm new

topaz fjord
#

console.log it to see it its not undefined

earnest phoenix
#

I think he means like
console.log(role);
to see what it outputs in the console

frail kestrel
#

yes

glossy mason
#

@high tinsel Have you tried:

message.content.includes("--addrole")
rain tulip
#

xD

#

;restart

glossy mason
earnest phoenix
#

wow i overlooked that when giving a suggestion before lmao... yeeeaa you should probs fix that ^ @high tinsel

rain tulip
#
const client = new Discord.Client();
DBLPoster.bind(client);
#

RangeError: You need to provide a client to bind to!

#

legit

trim plinth
topaz fjord
#

can anyone help me out with google's custom search api?

ruby gazelle
#

how do I do to create a command that looks for stuff on a certain site that I put in command?

clear hill
#

how to make bot never crash Discord.js?

trim plinth
#

use pm2

#

pm2 relaunches your bot on crash

#

(or code)

clear hill
#

HOW?

trim plinth
#

npm package

clear hill
#

What Is P@?

#

PM2?

trim plinth
#

pm2 is a npm package, search it up

clear hill
#

WHERE?

trim plinth
clear hill
#

and?

earnest phoenix
#

just use forever.js tbh

trim plinth
#

eh I prefer pm2

clear hill
#

forever.js?

trim plinth
#

both do the same thing

clear hill
#

npm install pm2?

trim plinth
#

yep

clear hill
#

pm2 start __.js?

trim plinth
#

yes

#

you can also name the process

#

like pm2 start __.js --name mything but you can't have spaces in the name

clear hill
#

wait

#

AAND?

trim plinth
#

yeah thats pretty much all the basics

clear hill
#

[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>?

trim plinth
#

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 logs as well
clear hill
#

when bot crsh aaaaaaaaaaaaaaaaaaauto restart?

trim plinth
#

yes

clear hill
#

WOW

#

and how i use forever.js

raw wharf
#

Why does this happen?

trim plinth
#

hmm

#

-bots BulzyKrown

gilded plankBOT
#
BulzyKrown#2400
Bots

@wise bloom

trim plinth
#

@raw wharf has it been approved?

clear hill
#

@trim plinth How I Use DBL?

raw wharf
#

@trim plinth yes

trim plinth
#

post in bugs then, must be a bug because it shouldn't do that

clear hill
#

@snarkyfetch How I Use DBL?

raw wharf
#

okay

clear hill
#

How I Use DBLapi?

earnest phoenix
#

Read the docs

clear hill
#

Done . Because It Dint Work!

trim plinth
#

did you do it correctly

clear hill
#

ye

trim plinth
#

show code

earnest phoenix
#

If it doesn't work then no, you did not do it correctly

frail harness
#

oof

clear hill
#
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);
});```
frail harness
#

looks good, now just post your token and you'll be even better

trim plinth
#

@clear hill does your bot have shards

frail harness
#

jk jk pls no ban

clear hill
#

id

#

idk

frail harness
#

oof

#

my bot has like two shards

#

but it's on 6 servers lmao

trim plinth
#

how do you not know if your bot doesn't have shards bloblul

frail harness
#

@trim plinth is yours sharded?

trim plinth
#

no my bot doesn't have shards, you should only start having shards by 1K guilds

frail harness
#

lol

#

made two shards anyway

earnest phoenix
#

The more shards the more memory Discord will hog

clear hill
#

?

trim plinth
#

oml

frail harness
#

jesus christ

#

dude

clear hill
#

LOL

trim plinth
#

yeah take that token outta there

#

regen that

clear hill
#

FORGET

frail harness
#

lmao

#

i almost copied it

trim plinth
#

somebody could've copied that so I suggest regening the token like rn

clear hill
#
const client = new Discord.Client();
const DBL = require("dblapi.js");
const dbl = new DBL(` `, client);

client.on('ready', () => {
    setInterval(() => {
        dbl.postStats(client.guilds.size);
    }, 1800000);
});```
#

??

earnest phoenix
#

regenerate your token @clear hill

#

If you do not, your bot will be deleted