Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Import
- import random
- import discord
- from discord.ext.commands import Bot
- from discord.ext import commands
- import asyncio
- import time
- from discord.voice_client import VoiceClient
- import json
- import io
- Client = discord.Client()
- client = commands.Bot(command_prefix = "-")
- Players = ["**Players**"]
- IsTaken = False
- BlockedIds = ['221691584385646593']
- crossServerChannels = []
- DM = True
- @client.event
- async def on_ready():
- print("RaidBot has started!")
- #Kode
- @client.event
- async def on_message(message):
- global IsTaken
- global DM
- IsTaken = False
- for player in Players:
- if message.author != player and message.author != "RaidBot#4623" and message.author.id != '420111084536725507':
- pass
- elif message.author == player:
- print("User is alredy registerd " + str(player))
- IsTaken = True
- if not IsTaken:
- Players.append(message.author)
- print("User registered!")
- if message.content.upper() == ".RAID START":
- pass
- if message.content.upper().startswith(".RAID WHO"):
- print("test")
- for player in Players:
- try:
- await client.send_message(message.channel, player)
- except discord.errors.HTTPException:
- print("Send failed!")
- pass
- if message.content.upper().startswith('.RAID START'):
- args = message.content.split(" ")
- if len(args) < 2:
- await client.send_message(message.channel, "**Error:** to few arguments!")
- else:
- Continue = True
- for BlockedId in BlockedIds:
- if message.author.id == BlockedId:
- Continue = False
- print("Someone who is blocked tryed to start, but got denied")
- await client.send_message(message.channel, "**Error:** You are blocked from the system")
- if Continue:
- await client.send_message(message.channel, "Raid started!")
- for player in Players:
- try:
- if Continue == True and DM:
- await client.send_message(player,str(message.author) + "> " + " ".join(args[2:]))
- except discord.errors.InvalidArgument:
- print("Could not send message")
- pass
- except discord.errors.HTTPException:
- print("Could not send message")
- for server in crossServerChannels:
- if Continue == True:
- await client.send_message(server, str(message.author) + "> " + " ".join(args[2:]))
- if message.content.upper()=='.RAID NIKKECRAFT':
- await client.send_message(message.channel,"The ip for nikkecraft is: \nnikkecraft.mcserv.me")
- if message.content.upper()=='.RAID NIKKECRAFT NORWAY':
- await client.send_message(message.channel,"IPen er: \nnikkecraft.mcserv.me")
- if message.content.upper().startswith(".RAID SETCHANNEL"):
- sent = await client.send_message(message.channel, "New channel set! ")
- crossServerChannels.append(message.channel)
- time.sleep(1)
- await client.delete_message(message)
- await client.delete_message(sent)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement