Advertisement
Guest User

Xeukxz Bot Code

a guest
Feb 21st, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.61 KB | None | 0 0
  1. const Discord = require('discord.js');
  2. const client = new Discord.Client();
  3. let balances = new Discord.Collection()
  4.  
  5.  
  6. client.on('ready', () => {
  7. console.log('Ready!');
  8. });
  9.  
  10. client.login('123456789');
  11.  
  12. const TOKEN = "123456789"
  13.  
  14. const prefix = "**"
  15.  
  16. var bot = new Discord.Client();
  17.  
  18. bot.on ("message", function(message) {
  19. console.log(`${message.guild}, ${message.channel.name}, ${message.author.tag}: ${message.content}`);
  20. //message.guild.channels.find("name", "test").send(`${message.guild}, ${message.channel.name}, ${message.author.tag}: ${message.content}`);
  21. });
  22.  
  23. bot.login(TOKEN);
  24.  
  25. client.on('ready', async () => {
  26. console.log('logged in as Xeukxz!');
  27. client.user.setGame('**help');
  28. });
  29.  
  30. client.on("message", message => {
  31. var command = function(input,output){
  32. if (message.author.equals(client.user)) return;
  33. if (message.content.toLowerCase() === prefix + input) {
  34. message.channel.send(output);
  35. };
  36. };
  37.  
  38. //trigger words
  39.  
  40. if(message.content == "fuck you") {
  41. message.author.send("nah fuck you")
  42. message.delete();
  43. }
  44.  
  45. if(message.content == "delete") {
  46. message.channel.sendMessage("Im A Faggot")
  47. message.delete();
  48. }
  49.  
  50. if(message.content == "ping") {
  51. message.channel.send("pong")
  52. }
  53.  
  54. //variables
  55.  
  56. var spin = [Math.floor(Math.random() * 20)]
  57. var coinflip = ["Heads", "Tails"]
  58.  
  59. //commands
  60.  
  61. if(message.content == prefix + "code") {
  62. message.channel.send("https://pastebin.com/nvVeB3Zd")
  63. }
  64.  
  65. // command("help", "**commands:** \n `**Shop` \n `**dice` \n `**spin` \n `**invite`");
  66. // command("shop", "**Shop** \n `token` - `Used To Spin The Wheel` \n `dice` - `Used To Roll Dices`");
  67. command("coinflip", coinflip[Math.floor(Math.random() * 2)]);
  68. command("mk", "Mk");
  69. command("working?", "Yes It Is Working!");
  70.  
  71. //Local Currencies
  72.  
  73. if(message.content == prefix + "tickets") {
  74. message.channel.send(tickets)
  75. }
  76.  
  77. if(message.content == prefix + "tokens") {
  78. message.channel.send(tokens)
  79. }
  80.  
  81. if(message.content == prefix + "points") {
  82. message.channel.send(points)
  83. }
  84.  
  85.  
  86. let user = balances[message.author.id]
  87. if(user == undefined) {
  88. balances[message.author.id] = {
  89. name: message.author.tag,
  90. balance: 5,
  91. tokens: 1,
  92. spins: 1,
  93. }
  94. user = balances[message.author.id]
  95. }
  96.  
  97. if(!message.content.startsWith('**')) return;
  98.  
  99. const args = message.content.substring(prefix.length).split(' ');
  100.  
  101. switch (args[0]) {
  102. case 'bal':
  103. message.channel.send(user.balance)
  104. break;
  105. case 'debug':
  106. console.log(balances)
  107.  
  108. break;
  109. case 'spin':
  110. if(tokens > 0) {
  111. tokens -= 1
  112. message.channel.send(`You Have Won ${spin} tickets`)
  113. tickets += spin
  114. } else if(tokens <= 0){
  115. message.channel.send("You Dont Have Enough Tokens")
  116. }
  117. break;
  118. case 'help':
  119. message.channel.send('`**commands:**` \n `**Shop` \n `**dice` \n `**spin` \n `**invite`')
  120. }
  121.  
  122. if(message.content == prefix + "test"){
  123. message.channel.send("Test Successful!")
  124. }
  125.  
  126. if(message.content == prefix + "ping") {
  127. message.channel.send("pong")
  128. }
  129.  
  130. if(message.content == prefix + "invite") {
  131. message.channel.send("https://discordapp.com/oauth2/authorize?client_id=360106811287928834&scope=bot&permissions=2146958591")
  132. }
  133.  
  134. //other shit
  135.  
  136. client.on('message', function(message) {
  137. if (message.author.bot) return;
  138. // **askmaker how are you?
  139. // howareyou
  140. // how are you
  141. // args = ['askmaker', 'how', 'are', 'you?']
  142. const args = message.content.substring(prefix.length).split(' ');
  143. })
  144.  
  145. var dice = "dice"
  146. var dice1 = Math.floor(Math.random(1) * 6)
  147. var dice2 = Math.floor(Math.random(1) * 6)
  148.  
  149. if(message.content == prefix + "dice") {
  150. if(dice >= 1) {
  151. dice -= 1;
  152. if(dice1 > dice2) {
  153. message.channel.send(`I rolled a ${dice1}, you rolled a ${dice2} therefor I win and you lost 1 point!`)
  154. points -= 1;
  155. } else if (dice1 < dice2) {
  156. message.channel.send(`I rolled a ${dice1}, you rolled a ${dice2} therefor you win and earned 2 points!`)
  157. points += 2;
  158. }
  159. }else if(dice == 0) {
  160. message.channel.send("You Do Not Have Enough Dice")
  161. }else if(dice < 0) {
  162. message.channel.send("there is a serious problem with thisbot and you must report this to the creator. message `Xeukxz#4192` and say `code blue` as if you do not then this bot may become unstable")
  163. }
  164. }
  165.  
  166. if(message.content == prefix + 'shop') {
  167. switch (args[0]) {
  168. case 'shop':
  169. if(args[1] == undefined) {
  170. return message.channel.send("You Need To State What You Would Like To Buy")
  171. }
  172. else if(args[1] == 'buy') {
  173. if(args[2] == 'token') {
  174. if(balances >=20 ){
  175. message.channel.send("success")
  176. balances -= 20;
  177. tokens += 1;
  178. }}else if(balances <= 20){
  179. message.channel.send(`You Need A Ballance Of 20. You Have A Ballance Of ${user.balance}`)
  180. }
  181. }else if(args[2] == 'dice'){
  182. if(balances >= 20) {
  183. message.channel.send("success")
  184. balances -= 20;
  185. dice += 1
  186. }else if(balances <= 20) {
  187. message.channel.send(`You Need A Ballance Of 20. You Have A Ballance Of ${user.balance}`)
  188. }
  189. }
  190. }
  191. }
  192.  
  193. });
  194.  
  195. let dice = 1
  196. let tickets = 0
  197. let tokens = 1
  198. let points = 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement