Replies: 19 comments
-
Hey, welcome to the GitHub Support Community! I see that you’re using the
I hope this helps fix your issue! If you have any questions or if something isn’t working correctly, please reply back! |
Beta Was this translation helpful? Give feedback.
-
Thanks for the quick response. Is there a specific area of the template that I paste this new code into so that it works properly? |
Beta Was this translation helpful? Give feedback.
-
No problem! You can place the |
Beta Was this translation helpful? Give feedback.
-
Can you paste me back the entire template with the new snippets of code in where it will work properly? If I can get it to upload successfully then I’ll be happy to mark your solution as approved. Thanks a bunch! |
Beta Was this translation helpful? Give feedback.
-
Of course, I would be perfectly fine pasting back the entire template for your issue. However, could you reply back with all the code from that code file and put it within a code-block? It will make it way easier for me to format all of your code and send it back to you (just make sure you leave out any private access tokens). |
Beta Was this translation helpful? Give feedback.
-
My knowledge with coding is very limited, which is why I’m using a template for this, the bot is very simplistic, it’s only function is to reply to command with a few random phrases. Here is the entire “bot” code, pasted directly from the file:
|
Beta Was this translation helpful? Give feedback.
-
^ There’s the entire code file. Your bot should pick a random reply from the |
Beta Was this translation helpful? Give feedback.
-
Worked perfectly, thanks so much! Marking your solution as approved right now! Great work! |
Beta Was this translation helpful? Give feedback.
-
Awesome! Glad it worked out well and I appreciate the fast replies! |
Beta Was this translation helpful? Give feedback.
-
Where is the option to mark your reply as a “solution”, I don’t see it. |
Beta Was this translation helpful? Give feedback.
-
Should be next to the Heart icon near the Reply button. |
Beta Was this translation helpful? Give feedback.
-
Hmm, I don’t see it - I see the heart icon, link and edit, in that order. Maybe it’s because my account here is brand new? Either way, I think people reading will see that you solved this for me. I really appreciate the help. If the “mark as solved” button appears in the future I’ll definitely check that for you. |
Beta Was this translation helpful? Give feedback.
-
Weird, don’t know why it isn’t showing up. Either way, glad I could help resolve this issue for you! |
Beta Was this translation helpful? Give feedback.
-
Hey, once last issue, which I’m sure is minor - the bot isn’t selecting at random, it’s choosing #3 each time. So, if I type in three different phrases into the code, it’s selecting #3 each time from the batch, it’s not randomizing. Any ideas? |
Beta Was this translation helpful? Give feedback.
-
In @Gisgar3’s defense: xkcd.comRandom NumberRFC 1149.5 specifies 4 as the standard IEEE-vetted random number. But seriously, it looks like the problem is that the random number is generated once and not on each call. Moving the generation of the random number to the
|
Beta Was this translation helpful? Give feedback.
-
Yes, that quick edit worked, thanks so much for the contribution to this issue! |
Beta Was this translation helpful? Give feedback.
-
Ahhh, that’s my bad. That’s what happens when I haven’t had coffee all day haha |
Beta Was this translation helpful? Give feedback.
-
Hey guys, I just wanted to let you know the “solution” button finally populated and I credited both of you with “solutions” for your contributions to this issue. Thanks again! |
Beta Was this translation helpful? Give feedback.
-
Hey everyone, sorry to tack on to an old thread, but I am trying to do the exact same thing as the OP with only one major difference. I’ve been looking for a solution for a long time now, and this is 95% of the way there… My question is, instead of using
Is there a way the bot could read from a much longer list? Preferably a text file. I am trying to create a bot that can randomly output lines from a list that is easy for my mods to update. Any help would be greatly appreciated. Thank you |
Beta Was this translation helpful? Give feedback.
-
Hello all,
I’m working on a Discord bot with basic coding that fits what I need, only thing it’s lacking is that the bot needs to respond with random messages that will be written into the code, rather than just a single response each time the command is sent.
So, something like “reply 1”, “reply 2”, “reply 3”, where the bot will randomly choose a response to send into the chat each time it hears the command.
Here is the template I’m using, it’s very basic and anyone that is even remotely more experienced with this stuff than I could quickly implement what I need here, I’m sure, then I can go into the code and start crafting the various responses:
Thank you in advance to anyone that chimes in with a simple solution here, I know it’s probably a really minor snippet of coding that needs to be added in.
Beta Was this translation helpful? Give feedback.
All reactions