Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import discord
- import logging
- import asyncio
- import json
- import smtplib
- import time
- import urllib.request
- import getpass
- global version
- version = 17
- global settings
- with open('settings.json', 'r') as fp:
- settings = json.load(fp)
- global game
- global idle
- global afk
- global bot
- global permafk
- global sleep
- global location
- global activity
- global typing
- global phone
- global mock
- global reverse
- global upper
- global lower
- global proper
- global title
- global off
- global nlwords
- global wrmode
- global nlchars
- game = None
- idle = False
- afk = ""
- bot = False
- permafk = False
- sleep = False
- location = "Nowhere"
- activity = "Nothing"
- typing = False
- phone = False
- mock = None
- reverse = False
- upper = False
- lower = False
- proper = False
- title = False
- off = False
- nlwords = False
- wrmode = False
- nlchars = False
- logger = logging.getLogger('discord')
- logger.setLevel(logging.ERROR)
- handler = logging.FileHandler(filename='bot.log', encoding='utf-8', mode='w')
- handler.setFormatter(logging.Formatter('%(asctime)s:%(levelname)s:%(name)s: %(message)s'))
- logger.addHandler(handler)
- client = discord.Client()
- @client.event
- async def on_ready():
- global start
- start = time.time()
- global smtpserver
- print(" _ _ _ _ _ _ _ _______ _ ")
- print("| | | | | (_) (_) | (_) ___ \ | | ")
- print("| | | | |_ _| |_| |_ _| |_/ / ___ | |_ ")
- print("| | | | __| | | | __| | ___ \/ _ \| __|")
- print("| |_| | |_| | | | |_| | |_/ / (_) | |_ ")
- print(" \___/ \__|_|_|_|\__|_\____/ \___/ \__|")
- print("Control Center")
- @client.event
- async def on_message(message):
- global game
- global idle
- global afk
- global bot
- global permafk
- global smtpserver
- global sleep
- global location
- global activity
- global typing
- global phone
- global mock
- global reverse
- global upper
- global lower
- global proper
- global version
- global start
- global settings
- global title
- global off
- global nlwords
- global wrmode
- global nlchars
- if off:
- if message.author == client.user and message.content.lower().startswith("<>on"):
- off = False
- await client.send_message(message.channel,"**UtilitiBot:** Turning on!")
- else:
- return
- locactiv = "@" + location + " - " + activity
- if message.author == mock:
- bot = True
- await client.send_message(message.channel, message.content)
- if idle:
- if client.user in message.mentions:
- if not sleep and not phone:
- content = message.clean_content + "\n\nReply at: https://discordapp.com/channels/" + message.server.id + "/" + message.channel.id
- ('UtilitiBot - Mention from '+message.author.name, content)
- bot = True
- await client.send_message(message.channel, ":zzz: **I am AFK: . o 0 ( "+afk+" ) 0 o . **")
- elif phone:
- await client.send_message(message.channel, ":phone: ** I am on my phone! ** :no_entry_sign: :computer:")
- elif sleep:
- bot = True
- await client.send_message(message.channel, ":zzz: ** . z Z ( I am sleeping! ) Z z . ** :sleeping:")
- if message.author == client.user:
- if not permafk and not sleep and not phone:
- if bot:
- bot = False
- return
- if message.content.startswith(":zzz: ** . z Z ( "):
- return
- idle = False
- afk = ""
- if game == None:
- await client.change_status(discord.Game(name=locactiv), idle)
- else:
- await client.change_status(discord.Game(name=game), idle)
- await client.send_message(message.channel, "**UtilitiBot:** I am back!")
- elif message.channel.is_private:
- if not sleep and not phone:
- ('UtilitiBot - PM from '+message.author.name, message.clean_content + "\n\nReply at: https://discordapp.com/channels/@me/" + message.channel.id )
- bot = True
- tmp = await client.send_message(message.channel, ":zzz: **I am AFK: . o 0 ( "+afk+" ) 0 o . **")
- await asyncio.sleep(5)
- await client.delete_message(tmp)
- elif phone:
- tmp = await client.send_message(message.channel, ":phone: ** I am on my phone! ** :no_entry_sign: :computer:")
- await asyncio.sleep(5)
- await client.delete_message(tmp)
- elif sleep:
- bot = True
- tmp = await client.send_message(message.channel, ":zzz: ** . z Z ( I am sleeping! ) Z z . ** :sleeping:")
- await asyncio.sleep(5)
- await client.delete_message(tmp)
- if message.content.lower().startswith("where is <@"+client.user.id+">"):
- bot = True
- await client.send_message(message.channel, "**UtilitiBot:** I am at "+location)
- elif message.content.lower().startswith("what is <@"+client.user.id+"> doing"):
- bot = True
- await client.send_message(message.channel, "**UtilitiBot:** I am "+activity)
- elif message.content.lower().startswith("what device is <@"+client.user.id+">"):
- bot = True
- if phone:
- await client.send_message(message.channel, "**UtilitiBot:** I am on my phone")
- else:
- await client.send_message(message.channel, "**UtilitiBot:** I am on my PC")
- elif message.channel.is_private:
- if message.author != client.user:
- if message.content.lower().startswith("where are you"):
- bot = True
- await client.send_message(message.channel, "**UtilitiBot:** I am at "+location)
- elif message.content.lower().startswith("what are you doing"):
- bot = True
- await client.send_message(message.channel, "**UtilitiBot:** I am "+activity)
- elif message.content.lower().startswith("what device are you"):
- bot = True
- if phone:
- await client.send_message(message.channel, "**UtilitiBot:** I am on my phone")
- else:
- await client.send_message(message.channel, "**UtilitiBot:** I am on my PC")
- if message.author != client.user:
- return
- if "(╯°□°)╯︵ ┻━┻" in message.content.lower():
- await client.send_message(message.channel, "**┬─┬ ノ( ゜-゜ノ)**")
- if "ayy" in message.content.lower():
- await client.send_message(message.channel, "**lmao**")
- if message.content.lower().startswith("where am i"):
- await client.send_message(message.channel, "**UtilitiBot:** You are at "+location)
- elif message.content.lower().startswith("what am i doing"):
- await client.send_message(message.channel, "**UtilitiBot:** You are "+activity)
- elif message.content.lower().startswith("what device am i"):
- if phone:
- await client.send_message(message.channel, "**UtilitiBot:** I am on my phone")
- else:
- await client.send_message(message.channel, "**UtilitiBot:** I am on my PC")
- lenny = {
- "lenny": "( ͡° ͜ʖ ͡°)",
- "sad": "[´• ╭╮ •`]",
- "mad": "( ͡° ʖ̯ ͡°)",
- "cat": "龴 ͡ↀ ◡ ͡ↀ龴",
- "sadlenny": "[´• ╭╮ •`]",
- "madlenny": "( ͡° ʖ̯ ͡°)",
- "catlenny": "龴 ͡ↀ ◡ ͡ↀ龴",
- "shrug": "¯\_(ツ)_/¯",
- "shruglenny": "¯\_(ツ)_/¯",
- "sunglass": "(⌐■_■)",
- "sunglasses": "(⌐■_■)",
- "sunglasslenny": "(⌐■_■)",
- "cool": "(⌐■_■)",
- "coollenny": "(⌐■_■)",
- "disapprove": "ಠ_ಠ",
- "disapprovelenny": "ಠ_ಠ",
- "neutrallenny": "( ͡° ͟ʖ ͡°)",
- "neutral": "( ͡° ͟ʖ ͡°)",
- "eyebrowlenny": "( ͠° ͜ʖ °)",
- "eyebrow": "( ͠° ͜ʖ °)",
- "mouthlenny": "( ͡°ᗜ ͡°)",
- "mouth": "( ͡°ᗜ ͡°)",
- "lennypede": """╚═( ͡° ͜ʖ ͡°)═╝
- ╚═(███)═╝
- ╚═(███)═╝
- .╚═(███)═╝
- ..╚═(███)═╝
- …╚═(███)═╝
- …╚═(███)═╝
- ..╚═(███)═╝
- .╚═(███)═╝
- ╚═(███)═╝
- .╚═(███)═╝
- ..╚═(███)═╝
- …╚═(███)═╝
- …╚═(███)═╝
- …..╚(███)╝
- ……╚(██)╝
- ………(█)
- ……….*
- """
- }
- msg = message.content
- for x in lenny:
- msg = msg.replace("<"+x+">", lenny[x])
- if wrmode:
- if proper:
- msg = list(msg)
- msg[0] = msg[0].capitalize()
- msg = "".join(msg)
- if not msg.endswith(".") and not msg.endswith("!") and not msg.endswith("?"):
- msg = msg + "."
- elif title:
- msg = msg.title()
- elif nlwords:
- msg = msg.replace(" ", "\n")
- elif nlchars:
- msg = "\n".join(msg)
- elif upper:
- msg = msg.upper()
- elif lower:
- msg = msg.lower()
- elif reverse:
- msg = msg[::-1]
- if msg != message.content:
- await client.edit_message(message, msg)
- if message.content.lower().startswith("<>help"):
- await client.send_message(message.channel, "**UtilitiBot:** Commands ```<>specs"+
- "\n<>upgrades```")
- elif message.content.lower().startswith("<>flush"):
- num = message.content.replace("<>flush ", "")
- if num.isdigit() == False:
- await client.send_message(message.channel, "**UtilitiBot:** Invalid Arguments")
- return
- num = int(num)
- counter = 0
- if num < 500:
- limit = 500
- else:
- limit = num * 4
- async for message in client.logs_from(message.channel, limit=limit):
- if message.author == client.user:
- await client.delete_message(message)
- counter += 1
- if counter == num + 1:
- break
- msg = await client.send_message(message.channel, "**UtilitiBot:** Flushed " + str(counter) + " Messages")
- await asyncio.sleep(2)
- await client.delete_message(msg)
- elif message.content.lower().startswith("<>aflush"):
- num = message.content.replace("<>aflush ", "")
- if num.isdigit() == False:
- await client.send_message(message.channel, "**UtilitiBot:** Invalid Arguments")
- return
- num = int(num)
- counter = 0
- async for message in client.logs_from(message.channel, limit=num+1):
- try:
- await client.delete_message(message)
- counter += 1
- except discord.errors.Forbidden:
- await client.send_message(message.channel, "**UtilitiBot:** Invalid Permissions!")
- break
- msg = await client.send_message(message.channel, "**UtilitiBot:** Flushed " + str(counter) + " Messages")
- await asyncio.sleep(2)
- await client.delete_message(msg)
- elif message.content.lower().startswith("<>uflush"):
- num = message.content.replace("<>uflush ", "")
- if len(message.mentions) == 0:
- await client.send_message(message.channel, "**UtilitiBot:** Invalid Arguments!")
- return
- elif len(message.mentions) == 1:
- user = message.mentions[0]
- else:
- await client.send_message(message.channel, "**UtilitiBot:** You mentioned too many users!")
- return
- num = num.replace(user.mention, "")
- num = num.replace(" ", "")
- if num.isdigit() == False:
- await client.send_message(message.channel, "**UtilitiBot:** Invalid Arguments")
- return
- num = int(num)
- counter = 0
- if num < 500:
- limit = 500
- else:
- limit = num * 4
- await client.delete_message(message)
- async for message in client.logs_from(message.channel, limit=limit):
- if message.author == user:
- try:
- await client.delete_message(message)
- counter += 1
- except discord.errors.Forbidden:
- await client.send_message(message.channel, "**UtilitiBot:** Invalid Permissions!")
- break
- if counter == num + 1:
- break
- msg = await client.send_message(message.channel, "**UtilitiBot:** Flushed " + str(counter) + " Messages")
- await asyncio.sleep(2)
- await client.delete_message(msg)
- elif message.content.lower().startswith("<>status"):
- game = message.content.replace("<>status ", "")
- if game == "" or message.content.lower() == "<>status":
- game = None
- if game == None:
- await client.change_status(discord.Game(name=locactiv), idle)
- else:
- await client.change_status(discord.Game(name=game), idle)
- await client.send_message(message.channel, "**UtilitiBot:** Status set to: **Playing** " + str(game))
- elif message.content.lower().startswith("<>afk"):
- if permafk:
- await client.send_message(message.channel, "**UtilitiBot:** I am already permafk!")
- return
- afk = message.content.replace("<>afk ", "")
- if afk == "" or message.content.lower() == "<>afk":
- afk = "AFK"
- idle = True
- await client.change_status(discord.Game(name="AFK: " + afk), idle)
- bot = True
- await client.send_message(message.channel, "**UtilitiBot:** I am now afk!")
- elif message.content.lower().startswith("<>permafk"):
- if not permafk and idle:
- await client.send_message(message.channel, "**UtilitiBot:** I am already AFK!")
- return
- afk = message.content.replace("<>permafk ", "")
- if afk == "" or message.content.lower() == "<>permafk":
- afk = "AFK"
- permafk = True
- idle = True
- await client.change_status(discord.Game(name="AFK: " + afk), idle)
- bot = True
- await client.send_message(message.channel, "**UtilitiBot:** I am now afk!")
- elif message.content.lower().startswith("<>back"):
- permafk = False
- idle = False
- afk = ""
- if game == None:
- await client.change_status(discord.Game(name=locactiv), idle)
- else:
- await client.change_status(discord.Game(name=game), idle)
- await client.send_message(message.channel, "**UtilitiBot:** I am now back!")
- elif message.content.lower().startswith("<>sleep"):
- if permafk or idle:
- await client.send_message(message.channel, "**UtilitiBot:** I am already AFK!")
- return
- sleep = True
- idle = True
- await client.change_status(discord.Game(name="Sleeping"), idle)
- bot = True
- await client.send_message(message.channel, "**UtilitiBot:** Goodnight!")
- elif message.content.lower().startswith("<>awake"):
- sleep = False
- idle = False
- permafk = False
- afk = ""
- if game == None:
- await client.change_status(discord.Game(name=locactiv), idle)
- else:
- await client.change_status(discord.Game(name=game), idle)
- await client.send_message(message.channel, "**UtilitiBot:** Good Morning!")
- elif message.content.lower().startswith("<>phone"):
- phone = True
- idle = True
- afk = "On phone"
- await client.change_status(discord.Game(name=afk), idle)
- await client.send_message(message.channel, "**UtilitiBot:** Set you to on your phone!")
- elif message.content.lower().startswith("<>pc"):
- phone = False
- idle = False
- afk = ""
- if game == None:
- await client.change_status(discord.Game(name=locactiv), idle)
- else:
- await client.change_status(discord.Game(name=game), idle)
- await client.send_message(message.channel, "**UtilitiBot:** Back on the PC!")
- elif message.content.lower().startswith("<>location"):
- location = message.content.replace("<>location ", "")
- if location == "" or message.content.lower() == "<>location":
- location = "Nowhere"
- locactiv = "@" + location + " - " + activity
- if game == None:
- await client.change_status(discord.Game(name=locactiv), idle)
- await client.send_message(message.channel, "**UtilitiBot:** Location set to @"+location)
- elif message.content.lower().startswith("<>activity"):
- activity = message.content.replace("<>activity ", "")
- if activity == "" or message.content.lower() == "<>activity":
- activity = "Nothing"
- locactiv = "@" + location + " - " + activity
- if game == None:
- await client.change_status(discord.Game(name=locactiv), idle)
- await client.send_message(message.channel, "**UtilitiBot:** Activity set to "+activity)
- elif message.content.lower().startswith("<>typing"):
- if typing:
- return
- if len(message.channel_mentions) == 0:
- channel = message.channel
- elif len(message.channel_mentions) == 1:
- channel = message.channel_mentions[0]
- else:
- await client.send_message(message.channel, "**UtilitiBot:** You mentioned too many channels!")
- return
- typing = True
- if not channel.is_private:
- await client.send_message(message.channel, "**UtilitiBot:** I am now madly typing away in "+channel.mention+"!")
- else:
- await client.send_message(message.channel, "**UtilitiBot:** I am now madly typing away in this channnel!")
- while True:
- await client.send_typing(channel)
- def check(msg):
- if msg.content.startswith('<>typing'):
- if msg.channel == channel or msg.channel == message.channel:
- return True
- else:
- return False
- else:
- return False
- msg = await client.wait_for_message(timeout=6, author=message.author, check=check)
- if msg != None:
- await client.send_message(msg.channel, "**UtilitiBot:** I stopped typing.")
- typing = False
- break
- elif message.content.lower().startswith("<>spam"):
- channel = None
- if not message.channel.is_private:
- if len(message.mentions) == 0:
- channel = None
- elif len(message.mentions) == 1:
- channel = message.mentions[0]
- else:
- await client.send_message(message.channel, "**UtilitiBot:** You mentioned too many users!")
- return
- if len(message.channel_mentions) == 0:
- if channel == None:
- channel = message.channel
- elif len(message.channel_mentions) == 1:
- if channel == None or message.channel == channel:
- channel = message.channel_mentions[0]
- else:
- await client.send_message(message.channel, "**UtilitiBot:** You mentioned too many channels and users!")
- return
- else:
- await client.send_message(message.channel, "**UtilitiBot:** You mentioned too many channels!")
- return
- else:
- channel = message.channel
- msg = message.content.replace("<>spam ", "")
- if not message.channel.is_private:
- msg = msg.replace(channel.mention, "")
- if msg == "" or message.content.lower() == "<>spam":
- await client.send_message(message.channel, "Invalid Arguments!")
- return
- if channel == message.channel:
- await client.edit_message(message, msg)
- limit = 4
- else:
- limit = 5
- counter = 0
- while counter < limit:
- await client.send_message(channel, msg)
- counter += 1
- elif message.content.lower().startswith("<>mock"):
- if not message.channel.is_private:
- if len(message.mentions) == 0:
- await client.send_message(message.channel, "**UtilitiBot:** Invalid Arguments!")
- return
- elif len(message.mentions) == 1:
- mock = message.mentions[0]
- else:
- await client.send_message(message.channel, "**UtilitiBot:** You mentioned too many users!")
- return
- else:
- mock = message.channel.user
- if mock == client.user:
- mock = None
- await client.send_message(message.channel, "**UtilitiBot:** You cannot mock yourself!")
- return
- await client.send_message(message.channel, "**UtilitiBot:** I am now mocking " + mock.mention)
- elif message.content.lower().startswith("<>unmock"):
- omock = mock
- mock = None
- mbot = True
- if omock != None:
- await client.send_message(message.channel, "**UtilitiBot:** I stopped mocking " + omock.mention)
- omock = None
- mbot = False
- elif message.content.lower().startswith("<>reverse"):
- if wrmode and not reverse:
- await client.send_message(message.channel, "**UtilitiBot:** Another writing mode is already on!")
- elif reverse:
- wrmode = False
- reverse = False
- await client.send_message(message.channel, "**UtilitiBot:** Message reversing off!")
- else:
- wrmode = True
- reverse = True
- await client.send_message(message.channel, "**UtilitiBot:** Message reversing on!")
- elif message.content.lower().startswith("<>upper"):
- if wrmode and not upper:
- await client.send_message(message.channel, "**UtilitiBot:** Another writing mode is already on!")
- elif upper:
- wrmode = False
- upper = False
- await client.send_message(message.channel, "**UtilitiBot:** Upper off!")
- else:
- wrmode = True
- upper = True
- await client.send_message(message.channel, "**UtilitiBot:** Upper on!")
- elif message.content.lower().startswith("<>lower"):
- if wrmode and not lower:
- await client.send_message(message.channel, "**UtilitiBot:** Another writing mode is already on!")
- elif lower:
- wrmode = False
- lower = False
- await client.send_message(message.channel, "**UtilitiBot:** Lower off!")
- else:
- wrmode = True
- lower = True
- await client.send_message(message.channel, "**UtilitiBot:** Lower on!")
- elif message.content.lower().startswith("<>proper"):
- if wrmode and not proper:
- await client.send_message(message.channel, "**UtilitiBot:** Another writing mode is already on!")
- elif proper:
- wrmode = False
- proper = False
- await client.send_message(message.channel, "**UtilitiBot:** Proper off!")
- else:
- wrmode = True
- proper = True
- await client.send_message(message.channel, "**UtilitiBot:** Proper on!")
- elif message.content.lower().startswith("<>title"):
- if wrmode and not title:
- await client.send_message(message.channel, "**UtilitiBot:** Another writing mode is already on!")
- elif title:
- wrmode = False
- title = False
- await client.send_message(message.channel, "**UtilitiBot:** Title off!")
- else:
- wrmode = True
- title = True
- await client.send_message(message.channel, "**UtilitiBot:** Title on!")
- elif message.content.lower().startswith("<>nlwords"):
- if wrmode and not nlwords:
- await client.send_message(message.channel, "**UtilitiBot:** Another writing mode is already on!")
- elif nlwords:
- wrmode = False
- nlwords = False
- await client.send_message(message.channel, "**UtilitiBot:** NLWords off!")
- else:
- wrmode = True
- nlwords = True
- await client.send_message(message.channel, "**UtilitiBot:** NLWords on!")
- elif message.content.lower().startswith("<>nlchars"):
- if wrmode and not nlchars:
- await client.send_message(message.channel, "**UtilitiBot:** Another writing mode is already on!")
- elif nlchars:
- wrmode = False
- nlchars = False
- await client.send_message(message.channel, "**UtilitiBot:** NLChars off!")
- else:
- wrmode = True
- nlchars = True
- await client.send_message(message.channel, "**UtilitiBot:** NLChars on!")
- elif message.content.lower().startswith("<>eval"):
- evalc = message.content.replace("<>eval ```", "")
- evalc = evalc.replace("```", "")
- if evalc == "" or evalc.lower().startswith("<>eval"):
- await client.send_message(message.channel, "**UtilitiBot:** Invalid Arguments!")
- return
- try:
- output = eval(evalc)
- except Exception as e:
- output = e
- await client.send_message(message.channel, "**UtilitiBot:** Output```\n"+str(output)+"```")
- elif message.content.lower().startswith("<>exec"):
- execc = message.content.replace("<>exec ```", "")
- execc = execc.replace("```", "")
- if execc == "" or execc.lower().startswith("<>exec"):
- await client.send_message(message.channel, "**UtilitiBot:** Invalid Arguments!")
- return
- try:
- output = exec(execc)
- except Exception as e:
- output = e
- await client.send_message(message.channel, "**UtilitiBot:** Output```\n"+str(output)+"```")
- elif message.content.lower().startswith("<>version"):
- await client.send_message(message.channel, "**UtilitiBot**: Revision "+str(version))
- elif message.content.lower().startswith("<>uptime"):
- stop = time.time()
- seconds = stop - start
- times = {}
- times['days'] = int(((seconds/60)/60)/24)
- times['hours'] = int((seconds/60)/60 - (times['days'] * 24))
- times['minutes'] = int((seconds/60)%60)
- times['seconds'] = int(seconds%60)
- wording = {
- "days": "days",
- "hours": "hours",
- "minutes": "minutes",
- "seconds": "seconds"
- }
- if times['days'] == 1:
- wording['days'] = "day"
- if times['hours'] == 1:
- wording['hours'] = "hour"
- if times['minutes'] == 1:
- wording['minutes'] = "minute"
- if times['seconds'] == 1:
- wording['seconds'] = "second"
- await client.send_message(message.channel, "**UtilitiBot:** I have been online for " + str(times['days']) + " "+wording['days']+", " +
- str(times['hours'])+" "+wording['hours']+", "+str(times['minutes'])+" "+wording['minutes']+" and "
- + str(times['seconds']) + " " + wording['seconds'])
- elif message.content.lower().startswith("<>update"):
- urllib.request.urlretrieve("https://raw.githubusercontent.com/Hackzzila/UtilitiBot/master/main.py", "main.py")
- await client.send_message(message.channel, "**UtilitiBot:** Updated! Now restart me.")
- elif message.content.lower().startswith("<>hardupdate"):
- urllib.request.urlretrieve("https://raw.githubusercontent.com/Hackzzila/UtilitiBot/master/main.py", "main.py")
- settings = {}
- settings['run'] = False
- with open('settings.json', 'w') as fp:
- json.dump(settings, fp)
- await client.send_message(message.channel, "**UtilitiBot:** Updated and all setting cleared! Now restart me.")
- elif message.content.lower().startswith("<>mail"):
- if settings['mailing']:
- settings['mailing'] = False
- await client.send_message(message.channel, "**UtilitiBot:** Mailing turned off!")
- else:
- settings['mailing'] = True
- ('UtilitiBot - Setup Email', "UtilitiBot is all setup! If you don't want mail do <>mail in chat.")
- await client.send_message(message.channel, "**UtilitiBot:** Mailing turned on!")
- with open('settings.json', 'w') as fp:
- json.dump(settings, fp)
- elif message.author == client.user and message.content.lower().startswith("<>shutdown"):
- await client.send_message(message.channel,"**UtilitiBot:** Closing, goodbye!")
- await client.logout()
- elif message.author == client.user and message.content.lower().startswith("<>off"):
- off = True
- await client.send_message(message.channel,"**UtilitiBot:** Turning off!")
- elif message.author == client.user and message.content.lower().startswith("<>ping"):
- await client.send_message(message.channel, "**UtilitiBot:** Pong")
- elif message.content.lower().startswith("<>reset"):
- game = None
- idle = False
- afk = ""
- bot = False
- permafk = False
- sleep = False
- typing = False
- phone = False
- mock = None
- reverse = False
- upper = False
- lower = False
- proper = False
- title = False
- nlwords = False
- wrmode = False
- nlchars = False
- location = "Nowhere"
- activity = "Nothing"
- await client.change_status(None, idle)
- await client.send_message(message.channel, "**UtilitiBot:** All variables reset!")
- elif message.content.lower().startswith("<>share"):
- await client.send_message(message.channel, "**UtilitiBot:** I am UtilitiBot, a personal Discord bot."+
- " To use me go to https://github.com/Hackzzila/UtilitiBot")
- if __name__ == "__main__":
- if settings['run']:
- client.run(settings['email'], settings['password'])
- else:
- print("Hey, welcome to UtilitiBot, running setup...")
- print(" ___ _ _ ")
- print("| \(_)___ __ ___ _ _ __| |")
- print("| |) | (_-</ _/ _ \ '_/ _` |")
- print("|___/|_/__/\__\___/_| \__,_|")
- settings['email'] = input("Email: ")
- settings['password'] = getpass.getpass('Password:')
- settings['run'] = True
- settings['mailing'] = True
- ('UtilitiBot - Setup Email', "UtilitiBot is all setup! If you don't want mail do <>mail in chat.")
- with open('settings.json', 'w') as fp:
- json.dump(settings, fp)
- print("")
- print("")
- print("")
- client.run(settings['email'], settings['password'])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement