{"id":89,"date":"2024-06-01T22:31:00","date_gmt":"2024-06-02T02:31:00","guid":{"rendered":"https:\/\/theroyalscode.com\/students\/a_reynolds\/?p=89"},"modified":"2025-12-23T15:22:33","modified_gmt":"2025-12-23T20:22:33","slug":"free-friday-5-17-24-makeup","status":"publish","type":"post","link":"https:\/\/theroyalscode.com\/students\/a_reynolds\/2024\/06\/01\/free-friday-5-17-24-makeup\/","title":{"rendered":"Working on my Discord Bot (Free Friday 5\/17\/24) (makeup)"},"content":{"rendered":"\n<div class=\"wp-block-group is-vertical is-content-justification-center is-layout-flex wp-container-core-group-is-layout-4b2eccd6 wp-block-group-is-layout-flex\">\n<p>Today I worked on my Discord Bot and added two commands, a help command and a roll dice command. The roll dice command takes in an argument for how many sides the dice will be, then it randomly selects a number between 1 and the number you entered, the default would be 6. A very, very simple function.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full is-resized\"><img fetchpriority=\"high\" decoding=\"async\" width=\"678\" height=\"436\" src=\"https:\/\/theroyalscode.com\/students\/a_reynolds\/wp-content\/uploads\/2024\/05\/code-2.png\" alt=\"\" class=\"wp-image-204\" style=\"width:513px;height:auto\" srcset=\"https:\/\/theroyalscode.com\/students\/a_reynolds\/wp-content\/uploads\/2024\/05\/code-2.png 678w, https:\/\/theroyalscode.com\/students\/a_reynolds\/wp-content\/uploads\/2024\/05\/code-2-300x193.png 300w, https:\/\/theroyalscode.com\/students\/a_reynolds\/wp-content\/uploads\/2024\/05\/code-2-600x386.png 600w\" sizes=\"(max-width: 678px) 100vw, 678px\" \/><\/figure>\n<\/div>\n\n\n<p>Next is part of the code that scans for messages in all the channels. If it sees &#8220;*roll&#8221; it in message, it will attempt to get the argument given and use the roll function to generate the random number and send it back to the user. If no argument is given, it just calls the function, since it defaults to 6.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img decoding=\"async\" width=\"1024\" height=\"592\" src=\"https:\/\/theroyalscode.com\/students\/a_reynolds\/wp-content\/uploads\/2024\/05\/code-3-1024x592.png\" alt=\"\" class=\"wp-image-205\" srcset=\"https:\/\/theroyalscode.com\/students\/a_reynolds\/wp-content\/uploads\/2024\/05\/code-3-1024x592.png 1024w, https:\/\/theroyalscode.com\/students\/a_reynolds\/wp-content\/uploads\/2024\/05\/code-3-300x173.png 300w, https:\/\/theroyalscode.com\/students\/a_reynolds\/wp-content\/uploads\/2024\/05\/code-3-768x444.png 768w, https:\/\/theroyalscode.com\/students\/a_reynolds\/wp-content\/uploads\/2024\/05\/code-3-600x347.png 600w, https:\/\/theroyalscode.com\/students\/a_reynolds\/wp-content\/uploads\/2024\/05\/code-3.png 1440w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n<\/div><\/div>\n\n\n\n<div class=\"wp-block-group is-vertical is-content-justification-center is-layout-flex wp-container-core-group-is-layout-4b2eccd6 wp-block-group-is-layout-flex\">\n<p>Here you can see me using the bot in action!<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img decoding=\"async\" width=\"341\" height=\"147\" src=\"https:\/\/theroyalscode.com\/students\/a_reynolds\/wp-content\/uploads\/2024\/05\/image_2024-05-31_112818768.png\" alt=\"\" class=\"wp-image-90\" srcset=\"https:\/\/theroyalscode.com\/students\/a_reynolds\/wp-content\/uploads\/2024\/05\/image_2024-05-31_112818768.png 341w, https:\/\/theroyalscode.com\/students\/a_reynolds\/wp-content\/uploads\/2024\/05\/image_2024-05-31_112818768-300x129.png 300w\" sizes=\"(max-width: 341px) 100vw, 341px\" \/><\/figure>\n<\/div><\/div>\n\n\n\n<div class=\"wp-block-group is-content-justification-center is-nowrap is-layout-flex wp-container-core-group-is-layout-94bc23d7 wp-block-group-is-layout-flex\">\n<div class=\"wp-block-group\"><div class=\"wp-block-group__inner-container is-layout-constrained wp-block-group-is-layout-constrained\">\n<p class=\"has-text-align-left\">Next up, the <strong>help<\/strong> command just gives a list of all commands available, nothing fancy. I plan on making this better by adding an embedded message.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"531\" height=\"338\" src=\"https:\/\/theroyalscode.com\/students\/a_reynolds\/wp-content\/uploads\/2024\/05\/Screenshot-2024-05-31-112735.png\" alt=\"\" class=\"wp-image-91\" srcset=\"https:\/\/theroyalscode.com\/students\/a_reynolds\/wp-content\/uploads\/2024\/05\/Screenshot-2024-05-31-112735.png 531w, https:\/\/theroyalscode.com\/students\/a_reynolds\/wp-content\/uploads\/2024\/05\/Screenshot-2024-05-31-112735-300x191.png 300w\" sizes=\"(max-width: 531px) 100vw, 531px\" \/><\/figure>\n<\/div><\/div><\/div>\n<\/div>\n\n\n\n<div class=\"wp-block-group is-vertical is-content-justification-center is-layout-flex wp-container-core-group-is-layout-4b2eccd6 wp-block-group-is-layout-flex\">\n<div class=\"wp-block-group\"><div class=\"wp-block-group__inner-container is-layout-constrained wp-block-group-is-layout-constrained\">\n<p>Here is most of the code:<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"505\" height=\"529\" src=\"https:\/\/theroyalscode.com\/students\/a_reynolds\/wp-content\/uploads\/2024\/05\/image_2024-05-31_113125972.png\" alt=\"\" class=\"wp-image-92\" srcset=\"https:\/\/theroyalscode.com\/students\/a_reynolds\/wp-content\/uploads\/2024\/05\/image_2024-05-31_113125972.png 505w, https:\/\/theroyalscode.com\/students\/a_reynolds\/wp-content\/uploads\/2024\/05\/image_2024-05-31_113125972-286x300.png 286w\" sizes=\"(max-width: 505px) 100vw, 505px\" \/><\/figure>\n<\/div><\/div><\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Today I worked on my Discord Bot and added two commands, a help command and a roll dice command. The roll dice command takes in an argument for how many sides the dice will be, then it randomly selects a number between 1 and the number you entered, the default would be 6. A very, [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-89","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/theroyalscode.com\/students\/a_reynolds\/wp-json\/wp\/v2\/posts\/89","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/theroyalscode.com\/students\/a_reynolds\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/theroyalscode.com\/students\/a_reynolds\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/theroyalscode.com\/students\/a_reynolds\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/theroyalscode.com\/students\/a_reynolds\/wp-json\/wp\/v2\/comments?post=89"}],"version-history":[{"count":6,"href":"https:\/\/theroyalscode.com\/students\/a_reynolds\/wp-json\/wp\/v2\/posts\/89\/revisions"}],"predecessor-version":[{"id":213,"href":"https:\/\/theroyalscode.com\/students\/a_reynolds\/wp-json\/wp\/v2\/posts\/89\/revisions\/213"}],"wp:attachment":[{"href":"https:\/\/theroyalscode.com\/students\/a_reynolds\/wp-json\/wp\/v2\/media?parent=89"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/theroyalscode.com\/students\/a_reynolds\/wp-json\/wp\/v2\/categories?post=89"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/theroyalscode.com\/students\/a_reynolds\/wp-json\/wp\/v2\/tags?post=89"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}