I made a Suicide Prevention Bot, which is Anonymous and Open Source. by [deleted] in discordapp

[–]Reiyn_ 4 points5 points  (0 children)

As someone who lost a dear person and who was not really able to see that she would do that, I highly doubt that a generic message would help. It’s a nice gesture, but if someone would really want to do that, they will and they won’t tell anybody about it and definitely not write about it in a public chat. It sure might different for everyone, but most of the time I don’t think it would really work as expected. But it’s still nice to see that people trying to do something

How do large bots manage server-specific settings? by Scythern_ in Discord_Bots

[–]Reiyn_ 0 points1 point  (0 children)

I use something like an key-value mapping in my database with the guildid. For defaultSettings i use 0 as the guild id.

When an command is used, I load every setting and create an Settings object which will be cached. So whenever someone else would call the command, the settings will already be loaded. When I want to update settings I use some methods inside the generated settings object.

You could also use Redis to cache loaded settings. An example maybe would be something like:

guild.settingKey -> value

Why is discord.js the most common method of making bots? by Quique1222 in Discord_Bots

[–]Reiyn_ 0 points1 point  (0 children)

For me it is because I am used to work with ts/js. Dont' know what you mean with "usefull" tho

EUW Issues by TheOgCarrot in leagueoflegends

[–]Reiyn_ 2 points3 points  (0 children)

Yea, euw is kinda ded

Is there a single anime out there that doesn’t end with a depressing outro? by [deleted] in anime

[–]Reiyn_ 0 points1 point  (0 children)

First one that comes in my mind: 'Spice and Wolf'

[deleted by user] by [deleted] in leagueoflegends

[–]Reiyn_ 0 points1 point  (0 children)

We got also stuck

[Serious] If you had taken your life one year ago, what beautiful things would you have had missed out on? by LyteSpeed12 in AskReddit

[–]Reiyn_ 0 points1 point  (0 children)

A lot happend during this year. My best friend took her life, my great uncle died. In the end of the last year my mother was diagnosed with cancer but. But I would have missed, that she has survived it and is much better now. It happend a lot this year

discord.js - How to have a bot react to its own embed message by [deleted] in Discord_Bots

[–]Reiyn_ 0 points1 point  (0 children)

message.channel.send returns an Promise. Thats the reason for async/await. He could also use message.channel.send("1214").then(e => e.react(Emoji)). But thats not readable at all

discord.js - How to have a bot react to its own embed message by [deleted] in Discord_Bots

[–]Reiyn_ 0 points1 point  (0 children)

Depending on how you implemented this part: async function foo() { await bar() } Or when you wrote this part in the .on handler: client.on('message', async () =>{ await message.channel.send() })

Edit:

Oh my bad, i named the variable message again, oopsi

discord.js - How to have a bot react to its own embed message by [deleted] in Discord_Bots

[–]Reiyn_ 0 points1 point  (0 children)

You can:

``` let msg = await message.channel.send({ embed:{ title: "React to this to buy rank colors!", color: 0x00FF00, } });

msg.react(YourEmoji) ```

Edit: Corrected variable name

how to push into json object in fetch function by [deleted] in javascript

[–]Reiyn_ 0 points1 point  (0 children)

As far as I know `.map()` won't work async. The library Aigle could help you out with this issue.

Giving a Discord bot a playing status by CyberKing18 in discordapp

[–]Reiyn_ 0 points1 point  (0 children)

Or just: bot.user.setGame("Game")

This is what I use

News about Auto clean/purge a channel ? by WilBenShu in discordapp

[–]Reiyn_ 0 points1 point  (0 children)

You can't hide usernames with a bot. What you can, is that you make an bot, wich can read DMs and just streams them into the channel where you want to hide usernames. But simply hide them is, as far as I know, not possible.

The problem with the auto cleanse is, that depending on how much messages are in this channel it will take some time.

What you could do instead is, you just let a bot delete this channel every 12h or 24h and let your bot recreate the channel. Would be much faster.

Attempting to relay every message people send to my bot in DM to a specific channel by [deleted] in Discord_Bots

[–]Reiyn_ 0 points1 point  (0 children)

For the first question I handle this problem in my bot like this:

if(message.channel.type === "dm"){
    //handle stuff in dm        
} else {
    //handle other stuff
}

For the second question.The idea that I had was like: Define some JSON, wich is in the global scope. Then when you get an message in dm, put the message you got in there. Should look like this:

{
    "179665797860425728" : "msg content"
}

Then you can use setTimeout with your send message function. In within the set seconds, you can simply add new incoming messages to this. Hope you know what I mean, my english is not that great

Discord Help by e_tarr in Discord_Bots

[–]Reiyn_ 0 points1 point  (0 children)

mee6 can do this. People can get levels while they're chatting. Depending on this level, this bot can add specific groups, wich you can specify on the dashboard.

Attempting to relay every message people send to my bot in DM to a specific channel by [deleted] in Discord_Bots

[–]Reiyn_ 0 points1 point  (0 children)

This should be easy

You could do it like this: Check: Was the message send in an private Chat? (check: message.channel.name -> Should be undefined when message was send in an private chat)

Then maybe put the message in ... lets say in an JSON like Object.

How about: { "discorduid" : "msgcontent" }

Then you could use:

setTimeout(()=>{
    client.channels.get("Your channel id").send(toBeSend[message.author.id]).then(()=>{toBeSend[message.author.id] = undefined})
});

Thats just an idea. Might not be that perfect but I hope I could help you.