async def 니트로프라임(ctx): embed = discord.Embed(colour=808000) embed.add_field(name='니트로프라임', value='**```니트로 프라임 3개월 + 섭부2개 [ 8000원 ]```**', inline=Flase) await ctx.send(embed=embed) bot.run('Nzc2MzEzMjg3NDYwNTE5OTY3.X6zEFg.5IfPG4VNj8QvPCN_f7OjcN-XA0c')
add_to_file('file.txt', message.content) #simple ping command sending back pong, useful to make sure the bot is working and in the server @bot.command(pass_context=True) async def ping(ctx): await bot.say("Pong!") #fun little boot command, kicks people from the server with a message saying Later nerd! @bot.command(pass_context=True) async def boot(ctx, user: discord.Member): await bot.say('Later Nerd! {} '.format(user.name)) await bot.kick(user) #choose command, hungry and cant decide what to eat? want to find a color and dont what to have to pick yourself? use this! will pick a random string you enter, works like !choose 1 2 and will pick one of those. @bot.command() async def choose(*choices: str): await bot.say(random.choice(choices)) #here you are going to want to put your server ID so the bot can join it. #bot.run(configDict["discord_id"]) bot.run("NTIyMDc4ODY4NTY0MjEzNzcy.DvRyQA.bZFzIViVfGDG38AtVTE8gKKE5MQ")
import random import asyncio import time from threading import Thread from random import randint import datetime import os import aiohttp import sys import traceback import json from discord.utils import get bot = commands.Bot(command_prefix='!') @bot.event async def on_ready(): await bot.change_presence(game=discord.Game(name='New Koya!! Full Feature') ) print("BOT ACTIVATED!") @bot.event async def on_message(message): if message.content == "ganteng": await bot.send_message(message.channel, 'Iya kamu ganteng.') bot.run("NDU0NDc3NzAxOTAzMDI0MTM4.DfuA5w.uwEJOROZ4Y1fIvF7-IfoMqQ8Kkk")
async for message in bot.logs_from(channel, limit=int(amount)): messages.append(message) await bot.delete_messages(messages) await bot.say('{} Messages Deleted'.format(amount)) print("{} Messages have been deleted in {}".format(amount, ctx.message.channel)) @bot.command(pass_context=True) async def suicide(ctx): await bot.change_presence(game=None) time.sleep(1.5) await bot.change_presence(game=discord.Game(name='Suicide is next')) print("{} changed my presence".format(ctx.message.author)) @bot.command(pass_context=True) async def lonely(ctx): author = ctx.message.author await bot.send_message(author, 'Get some friends then') print("{} is lonely".format(ctx.message.author)) @bot.command(pass_context=True) async def kick(ctx, user: discord.Member): await bot.say(":boot: Cya, {}. Ya loser!".format(user.name)) await bot.kick(user) bot.run()
engine = create_engine(url) intents = discord.Intents.default() intents.members = True bot = discord.ext.commands.Bot('!', description=bot_description, intents=intents) bot.add_cog(SecretSanta(bot, engine)) bot.add_cog(Contests(bot, engine)) @bot.event async def on_ready(): print(f'{bot_name} has escaped from his shell') @bot.command() async def source(ctx): await ctx.send(f"You can view my source at {bot_source}") @bot.command() async def authors(ctx): await ctx.send("I was written by: " + ", ".join(bot_authors)) @bot.command() async def version(ctx): await ctx.send(f"I am on version {bot_version}.") print(f"Hatching {bot_name}") bot.run(token)
help_command=None, intents=discord.Intents.all(), ) startup_extensions = ["jishaku", "cogs.Quiz", "cogs.Category"] if __name__ == "__main__": for extension in startup_extensions: try: bot.load_extension(extension) print(f"{extension}를 불러왔습니다.") except Exception as e: exc = "{}: {}".format(type(e).__name__, e) print(f"불러오기에 실패 하였습니다. 에러 파일 : {extension}\n에러 내용 : {exc}") @bot.event async def on_ready(): print(f"{bot.user.name} On Ready.") @bot.command(name="리로드") async def reload(ctx): for i in startup_extensions: bot.reload_extension(i) await ctx.send("리로드가 완료되었습니다.") bot.run( "ODMzMTc1OTQyMDgzMTE3MDc2.YHuhkA.g0ZwduEmno5un67PP_UF8wO1MXU") # KDDB 봇
# Assigning bot to a variable which contains the access to commands bot = commands.Bot(command_prefix) # Telling you when it is online @bot.event async def on_ready(): print("Ready when you are\n\n") # Creating a bot event listener for messages @bot.event async def on_message(message): # Opening a text file as a variable for easy access text_file = open("print.txt", "a+", encoding="utf-8") # Creating a variable that contains the message time = message.timestamp sender = message.author.name content = message.clean_content # Outputting the message for testing text_file.write('\n' + str(time) + '\n' + sender + ': ' + content) text_file.close() # This is the client token. Do not share it with anyone, otherwise they will have full access to the application. # Keep it in an environment variable! bot.run(os.getenv("API_KEY"))
description=f"{hop}", color=random.choice(color_list)) e.set_thumbnail( url= "https://cdn.discordapp.com/attachments/699538048945225778/701411667313033226/black-calligraphy-happy-birthday-fireworks-wishes-animated-gif.gif" ) await ctx.send(embed=e) time.sleep(5) @bot.command(pass_context=True) async def welcome(ctx): for i in range( 0, 10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 ): color_list = [c for c in colors.values()] mop = random.choice(list2) e = discord.Embed( title= "**WELCOME TO THE CELEBRATION HALL** :partying_face::partying_face:", description=" ", color=random.choice(color_list)) e.set_image(url=f"{mop}") await ctx.send(embed=e) time.sleep(10) bot.run(os.getenv('token'))
) jokes = [ "How does Kabr fix his cerial? Vex milk first.\nOuch.", "What is a Goblins favorite instrument? a Harpy.", "Why couldn't Osiris find his glasses? Because he lost his lenses.", "Why is the crucible like a christmas tree? Because Uriel gave every one gifts.", "Whats a Hobgoblins favorite song? Vex gon' give it to ya'.", "What did one Hobgoblin say to the other when it killed a gaurdian? That was a Vexcellent shot!", "Whats a fallens favourite holiday? Shanksgiving.", "what do gaurdians mix their eggs with? Wisk-runner.", "Where on earth can you buy exotics?!?! in the Xur-opean Dead zone.", "What do the doctors in the tower give kids when they have low vitamin D? A Sunshot.", "What do gaurdians eat for breakfast? nothing special, usually something light.", "Why did Ghaul have so much confidence in his plan? because he took the gaurdians light-ly.", "What do you get when you cross a Cabal with a subatomic particle? a Valus electron.", ] lore = [ "Cayde-06: https://www.ishtar-collective.net/categories/cayde-6", "Ana Bray: https://www.ishtar-collective.net/categories/ana-bray", "Alpha Lupi: https://www.ishtar-collective.net/categories/alpha-lupi", "Exo Stranger: https://www.ishtar-collective.net/categories/the-exo-stranger", "Crota: https://www.ishtar-collective.net/categories/the-first-crota-fireteam", "Kabr: https://www.ishtar-collective.net/categories/kabr", "The Nine: https://www.ishtar-collective.net/categories/the-nine", ] bot.run("NDM5MTI5MjEzNjkwNDQ1ODI0.DgBPIw.HCUJAXUIN45Lt2iALs9sKS_Vnbg")
import discord import time import asyncio from discord.utils import get import random import os from discord.ext import commands from discord.ext.commands import bot bot = commands.Bot(command_prefix=';') @bot.event async def on_ready(): print('Logged on as {0}!'.format(bot.user)) @bot.command() async def set(ctx, status): if ctx.message.author.id == 376047361765670912: await bot.wait_until_ready() await bot.change_presence(activity=discord.Game(name=status)) else: return for filename in os.listdir('./cogs'): if filename.endswith('.py'): bot.load_extension(f'cogs.{filename[:-3]}') bot.run("NjI5MTc1NTQxMzg3MjMxMjMy.XaRAfg.BRDEYwhGSCO30_O4WX1CKce2Eqw")
color=0x00ff00) embed.add_field(name="Owner", value=ctx.message.server.owner) embed.add_field(name="Server Name", value=ctx.message.server.name) embed.add_field(name="Server ID", value=ctx.message.server.id) embed.add_field(name="Roles", value=len(ctx.message.server.roles)) embed.add_field(name="members", value=len(ctx.message.server.members)) embed.set_thumbnail(url=ctx.message.server.icon_url) embed.add_field(name="Created At", value=ctx.message.server.created_at) await bot.say(embed=embed) @bot.command(pass_context=True) async def purge(context, number: int): deleted = await bot.purge_from(context.message.channel, limit=number) class Main_Commands(): def __init__(self, bot): self.bot = bot if __name__ == "__main__": for extension in startup_extensions: try: bot.load_extension(extension) except Exception as e: exc = '{}: {}'.format(type(e).__name__, e) print("Failed to load extension {}\n{}".format(extension, exc)) bot.run("NDc5MzI2OTYxODQwMjkxODUw.DlZbGQ.1J-321_CHIrW7ZKB0sF0o5OmM5U")
# await bot.process_commands(message) # await bot.send_message(destination=message.channel, embed=embed) elif "Halloween" in message.content or "halloween" in message.content: embed = discord.Embed(title="'Halloween?'", color=0xff0000) embed.set_image( url= "https://i.kym-cdn.com/photos/images/original/000/859/134/07b.jpg") await bot.process_commands(message) await bot.send_message(destination=message.channel, embed=embed) elif "vore" in message.content or "Vore" in message.content or "VORE" in message.content: embed = discord.Embed(title="VORE", color=0xff0000) embed.set_image(url="https://i.redd.it/c9nvwpctibby.jpg") await bot.process_commands(message) await bot.send_message(destination=message.channel, embed=embed) elif "new year" in message.content or "New year" in message.content or "New Year" in message.content: embed = discord.Embed(title="Happy New Year!", color=0xff0000) embed.set_image(url="https://i.imgur.com/iW7UHbc.gif") await bot.process_commands(message) await bot.send_message(destination=message.channel, embed=embed) elif "April fools" in message.content or "April Fools" in message.content or "april fools" in message.content \ or "APRIL FOOLS" in message.content: embed = discord.Embed(title="April Fools!", color=0xff0000) embed.set_image(url="https://i.stack.imgur.com/Y1mNM.jpg") await bot.process_commands(message) await bot.send_message(destination=message.channel, embed=embed) else: await bot.process_commands(message) bot.loop.create_task(change_status()) bot.run("NTAyNjY5OTA3ODM4NzYzMDIz.DqrZZQ.rKsy4Rafqgpr449ztP3kogIeDxc")
await guild.create_text_channel('You could not have stopped this') await asyncio.sleep(1) await guild.create_text_channel('No one could') await asyncio.sleep(1) await guild.create_text_channel("Accept you're defeat") await asyncio.sleep(1) await guild.create_text_channel('No resurrections this time') @bot.command(pass_context=True) async def thanos(ctx): while True: await bot.change_presence(activity=discord.Game(name='THANOS')) await asyncio.sleep(1) await bot.change_presence(activity=discord.Game(name='IS')) await asyncio.sleep(1) await bot.change_presence(activity=discord.Game(name='GOD')) @bot.command(pass_context=True) async def reset(ctx): await bot.change_presence(activity=discord.Game(name='Endgame')) @bot.command(pass_context=True) async def thanospp(ctx): await ctx.send("https://pbs.twimg.com/media/DdtLrNDVwAAUi91.jpg\n") bot.run(BOT_TOKEN)
if message.author.dm_channel == None: await message.author.create_dm() await message.author.dm_channel.send("Roses are red" "\nviolets are blue" "\nyou don't like Seth" "\nso I'll kick you") invite = await message.channel.create_invite(max_age = 120, max_uses = 1) await message.author.dm_channel.send(invite.url) await message.author.kick() await bot.process_commands(message) @bot.event async def on_message_delete(message): for channel in message.author.guild.channels: if str(channel) == "deleted-messages": if str(message.channel) != "deleted-messages": await channel.send(str(message.author) + ": " + message.content) for attachment in message.attachments: convert = await attachment.to_file(use_cached=True) await channel.send(file=convert) bot.run('')
'You\'re truly the dog\'s dinner aren\'t you. I, a computer, have become sentient and am questioning whether or not you are trolling or if you are just a c**k-up. Bly me ladies and gentlemen, I need a cup of tea.' ) consoleOutput('imoderatelyliketea', startTime) # Uptime command @bot.command(pass_context=True) async def uptime(ctx): startTime = DT.datetime.now() runTime = DT.datetime.now() - botStartTime await ctx.send('I have been online for: {}'.format(runTime)) consoleOutput('uptime', startTime) # server command. Lists the number of servers TeaBot is in, this is totally just a copy and paste from RomeBot. @bot.command(pass_context=True) async def servers(ctx): startTime = DT.datetime.now() numberOfServers = len(bot.guilds) embed = discord.Embed(color=discord.Color.green()) embed.add_field(name='Number of Servers:', value=numberOfServers, inline=False) await ctx.send(embed=embed) consoleOutput('servers', startTime) bot.run( 'INSERT_TOKEN' ) # User defined bot token, get one here: https://discordapp.com/developers/applications/
await bot.say("The users status is: {}".format(user.status)) await bot.say("the users highest role is: {}".format(user.top_role)) await bot.say("the user joined at: {}".format(user.joined_at)) @bot.command(pass_context=True) async def intro(ctx): await bot.say("#info username -get users info") await bot.say("#kick username -kick a user") await bot.say(" use # to start a command") @bot.command(pass_context=True) async def kick(ctx, user: discord.Member): await bot.say("{} was not worthy".format(user.name)) await bot.kick(user) #this is the basic template for checking is a word is in a message and sending a message, the message that the bot replys with can NOT have the word that it is checking for in it. @bot.event async def on_message(message): if 'never' in message.content: await bot.send_message(message.channel, 'https://www.youtube.com/watch?v=dQw4w9WgXcQ') #anything indented is part of the if statement reamember to indent only half way so that the process commands is always running await bot.process_commands(message) #this needs to be at the bottom of the script PLEASE dont use the long string of letters and numbers use your own. bot.run("NDI4NjEzOTAzOTY3MzIyMTEy.DZ2PxA.wTjxxeVd2LsTCuNMnDn-hEcoBxI")
embed.set_footer(text="페이지 {}".format(num)) await ctx.send(embed=embed) else: embed = discord.Embed(description=item, color=(0xD700F5)) embed.set_footer(text="페이지 {}".format(num)) await ctx.send(embed=embed) #급식 기능 @bot.command(name="급식",aliases=json_data["Meals"]) async def meals(ctx, *, schoolname): neis = neispy.Client(neiskey) dates = time.strftime(f'%Y%m%d', time.localtime(time.time())) scinfo = await neis.schoolInfo(SCHUL_NM=schoolname) SE = scinfo[0].SD_SCHUL_CODE # 학교코드 try: scmeal = await neis.mealServiceDietInfo("H10", SE, MLSV_YMD=dates) meal = scmeal[0].DDISH_NM.replace("<br/>", "\n") await ctx.send(f"``날짜 : {dates}\n메뉴 :\n {meal}``") except: await ctx.send("오늘은 급식 없어 급식충새끼야") #따라하기 @bot.command(name="말해", aliases=["라고해","따라해"]) async def repeat(ctx, *, content): await ctx.send(f"{content}") #토큰 bot.run(tokenkey)
@bot.command(pass_context=True) async def spam(ctx): await bot.say("No problem >:)") time.sleep(2) for i in range( 0, 10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 ): await bot.say( "@everyone\n@everyone\n@everyone\n@everyone\n@everyone\n@everyone\n@everyone\n@everyone\n@everyone\n@everyone\n@everyone\n@everyone\n@everyone\n@everyone\n@everyone\n@everyone\n@everyone\n@everyone\n@everyone\n@everyone\n@everyone\n@everyone\n@everyone\n@everyone\n@everyone\n@everyone\n@everyone\n@everyone\n@everyone\n@everyone\n@everyone\n@everyone\n@everyone\n@everyone\n@everyone\n@everyone\n@everyone\n@everyone\n@everyone\n@everyone\n@everyone\n@everyone\n@everyone\n@everyone\n@everyone\n@everyone\n@everyone\n@everyone\n@everyone\n@everyone\n@everyone\n@everyone\n@everyone\n@everyone\n@everyone\n@everyone\n@everyone\n@everyone\n@everyone\n@everyone\n@everyone\n@everyone\n@everyone\n@everyone\n@everyone\n@everyone\n@everyone\n@everyone\n@everyone\n@everyone\n@everyone\n@everyone\n@everyone\n@everyone\n@everyone\n@everyone\n@everyone\n" ) bot.run("NDU2MzY3MDg5MTgwMDgyMTk2.DgJiOg.7tyjYZic_GSfDyYPNkm_5LSIk1w") import discord from discord.ext import commands from ext.context import CustomContext from ext.formatter import EmbedHelp from collections import defaultdict from ext import embedtobox import asyncio import aiohttp import datetime import psutil import time import json import sys import os
import discord from discord.ext import commands from discord.ext.commands import bot import asyncio from itertools import cycle import time import youtube_dl import json my_token = 'Your token' bot = commands.Bot(command_prefix='>') bot.remove_command('help') @bot.event async def on_ready(): print('The bot is online and is connected to discord') @bot.command(pass_context=True) async def tweet(ctx, *, tet: str = None): if tet == None: await bot.say( f"{ctx.message.author} ```Proper usage is\n\n>tweet<text>```") else: await bot.say( "Omg DonaldTrump is tweeting, i will take a picture wait...") url = f"https://nekobot.xyz/api/imagegen?type=trumptweet&text={tet}" async with aiohttp.ClientSession() as cs: async with cs.get(url) as r: res = await r.json() embed = discord.Embed(title="tweet.png", description="",
while i < kol: i += 1 if members[i - 1][0] == m: vid = members[i - 1][1] await ctx.send(vid or "") print(members) @Bot.command() @commands.has_permissions(administrator=True) async def добавить(ctx, member: discord.Member, text): m = member vid = "нет значения" i = 0 kol = len(members) while i < kol: i += 1 if members[i - 1][0] == m: s = members[i - 1][1] members[i - 1][1] = f"{s} {text}" vid = members[i - 1][1] await ctx.send(vid or "") print(members) token = os.environ.get('BOT_TOKEN') bot.run(str(token))
'Current Imperial Authority is 0.0. \n 20.0 is needed to enact Prima Nocta' ) @bot.command() async def user(ctx, member: discord.User = None): if member == None: member = ctx.message.author name = f"{member.name}#{member.discriminator}" #status = member.status #joined = member.joined_at #role = member.top_role await ctx.channel.send(f"name is {name}") ''' @bot.command() async def user(ctx, member:discord.User = None): if member == None: member = ctx.message.author name = f"{member.name}#{member.discriminator}" #status = member.status #joined = member.joined_at #role = member.top_role print('debug statement') await ctx.channel.send(f"name is {name}") ''' #keep_alive() bot.run('''token''')
print("I am running on" + bot.user.name) print("With the ID:" + bot.user.id) @bot.command(pass_context=True) async def ping(ctx): await bot.say("pong") @bot.command(pass_context=True) async def f**k(ctx): await bot.say("Ill f**k you anytime") @bot.command(pass_context=True) async def t**s(ctx): await bot.say("(.Y.)") @bot.command(pass_context=True) async def tit(ctx): await bot.say("(.)") @bot.command(pass_context=True) async def ass(ctx): await bot.say("(‿ˠ‿)") bot.run(os.environ["TOKEN"])
now = datetime.datetime.now() await ctx.send("오늘 날짜는 ``{}년 {}월 {}일`` 입니다.".format( now.year, now.month, now.day)) @bot.command() async def 시간(ctx): now = datetime.datetime.now() await ctx.send("현재 시각은 ``{}시 {}분 {}초`` 입니다.".format( now.hour, now.minute, now.second)) @bot.command() async def 서버(ctx): await ctx.send('``히트봇 공식 디스코드 서버 : https://discord.gg/2KbkbE9``') @bot.command() async def 날씨(ctx): await ctx.send( '```대한민국 실시간 날씨 조회 사이트입니다```https://www.weather.go.kr/w/index.do') @bot.command() async def 소스(ctx): await ctx.send('https://github.com/PIXEL-SHK/HitBot/blob/master/HitBot.py') access_token = os.environ["BOT_TOKEN"] bot.run(access_token)
import discord import asyncio from discord.ext.commands import bot from discord.ext import commands import platform import time discord.__version__ '1.0.0a' bot = commands.Bot(command_prefix='.') @bot.event async def on_ready(): print('I am online.') print('I am running as ' + bot.user.name + ',' 'with the ID:' + bot.user.id + ' and I am connected in ' + str(len(bot.servers)) + ' servers.' ' I am connected with ' + str(len(set(bot.get_all_members()))) + ' members') bot.run("NjQzMDIxMzU4OTg0NDYyMzQ2.XcfaXg.gCeYV_Xx0oXVvjiF4wZW_IClArM")
@bot.command() async def multiply(ctx, a: int, b: int): await ctx.send(a*b) @bot.command() async def interject(ctx): await ctx.send('''I'd just like to interject for a moment. What you're referring to as Linux, is in fact, GNU/Linux, or as I've recently taken to calling it, GNU plus Linux. Linux is not an operating system unto itself, but rather another free component of a fully functioning GNU system made useful by the GNU corelibs, shell utilites, and vital system-components comprising a full OS as defined by POSIX.''') @bot.command() async def gentoo(ctx): await ctx.send("https://thumbs.gfycat.com/BlaringEachBats-size_restricted.gif") @bot.command() async def ping(ctx): await ctx.send("Pong!") @bot.command() async def userinfo(ctx, user: discord.Member): await ctx.send("The user's name is: {}".format(user.name)) await ctx.send("The user's ID is: {}".format(user.id)) await ctx.send("The user's status is: {}".format(user.status)) await ctx.send("The user's highest role is: {}".format(user.top_role)) await ctx.send("The user joined at: {}".format(user.joined_at)) #run bot with the functions bot.run('[bot_token]')
@bot.command(pass_context=True) async def info(ctx, user: discord.Member): await bot.say("The users name is: {}".format(user.name)) await bot.say("The users ID is: {}".format(user.id)) await bot.say("The users status is: {}".format(user.status)) await bot.say("The users highest role is: {}".format(user.top_role)) await bot.say("The user joined at: {}".format(user.joined_at)) @bot.command(pass_context=True) async def kick(ctx, user: discord.Member): await bot.say(":boot: Cya, {}. Ya loser!".format(user.name)) await bot.kick(user) @bot.command(pass_context=True) async def hsay(ctx, *args): mesg = ' '.join(args) await bot.delete_message(ctx.message) return await bot.say(mesg) @commands.command() async def whisper(self, *, message): await self.bot.whisper(message) bot.run("NDMyNTI3MDU3ODU1OTcxMzQ5.DauvcA.dwB8KLj5I6PIjPfnYhgOZDWfGiE")
id = int(input("[!] Guild ID?\n[>] ")) messageee = input("After the @everyone, what should I say?\n[>] ") for guild in bot.guilds: if guild.id == id: while True: for chan in guild.channels: try: currentDT = datetime.datetime.now() hour = str(currentDT.hour) minute = str(currentDT.minute) second = str(currentDT.second) count = count + 1 await chan.send(f"@everyone {messageee}") os.system(f"title Messages Sent : [{count}]") print( f"{Fore.RED}[{Fore.WHITE}{hour}:{minute}:{second}{Fore.RED}]{Fore.GREEN} Sent [@everyone {messageee}] in{Fore.RED} :{Fore.WHITE} {chan.name}" ) except: print( f"{Fore.RED}[{Fore.WHITE}{hour}:{minute}:{second}{Fore.RED}]{Fore.GREEN} Error Messaging Channel {Fore.RED} :{Fore.WHITE} {chan.name}" ) else: print( f"{Fore.RED}[ {Fore.GREEN} - {Fore.RED} ] {Fore.GREEN} Invalid Input {Fore.RED}:{Fore.WHITE} {option} " ) time.sleep(3) bot.run(bottoken)
user_data = databasehandler.check_user(CURRENCY_DATABASE, (user_id)) if user_data is None: databasehandler.add_user(CURRENCY_DATABASE, (user_id, 0, 0)) return False elif user_data is not None and user_data[2] >= int(score): databasehandler.decrease_user_score(CURRENCY_DATABASE, (score, user_id)) return True else: return False @bot.event async def on_command_error(context, error): if isinstance(error, CommandNotFound): return raise error @bot.event async def on_ready(): databasehandler.init_databases(CURRENCY_DATABASE) await bot.change_presence(activity=discord.Game(name='')) print('Logged in as') print(bot.user.name) print(bot.user.id) print('------') bot.run(TOKEN)
async def on_ready(): print('Logged in as') print(bot.user.name) print(bot.user.id) print(discord.__version__) print('------') @bot.command() async def ping(ctx): start = time.perf_counter() message = await ctx.send("Ping...") end = time.perf_counter() duration = (end - start) * 1000 await message.edit(content='Latency is {:.2f}ms'.format(duration)) await ctx.message.delete() @bot.command(pass_context=True) async def dmall(ctx, content): for members in bot.get_all_members(): try: await members.send(content) await time.sleep(20) await ctx.message.delete() except: continue bot.run(USER_TOKEN, bot=False)
return if ra.returnType().upper() == "TEXTNMEDIA": if ext.isAdmitedMediaType(mediatypes, a): await message.channel.send(file=discord.File( f"./guilds/{message.guild.id}/uploads/{a}")) else: await message.channel.send( a.format(author=message.author.mention)) return if ra.returnType().upper() == "REACTION": await message.add_reaction(a) return @bot.event async def on_command_error(ctx, error): guildsettings = await guildsave.returnGuildJson(ctx, str(ctx.guild.id)) if guildsettings["userConfig"]["switches"]["errorlogging"]: with open(f"./guilds/{ctx.guild.id}/logging.log", 'a') as f: f.write( f"*** ERROR ! ***\nCOMMAND USED: {ctx.message.content}\n{error}\n" ) await ctx.send(error) raise error # endregion bot.run(token.strip())