from discord.ext import commands import discord import asyncio import json import pyson import os, errno import datetime import time import aiohttp config = pyson.Pyson('data.json') token = config.data.get('config').get('token') Items = { "neidans": 100000, "spikes": 82000, "coins": 100000, "goblets": 100000000, "skins": 42800, "whiskers": 100000000, "fins": 100000000, "horns": 53700, "shells": 409200, "steels": 100000000, "jaws": 52400, "tongues": 100000000, "amethysts": 100000000, } bot = commands.Bot(command_prefix='!')
from discord.ext import commands import discord import pyson import time config = pyson.Pyson('lfc.json') token = config.data.get('config').get('token') bot = commands.Bot(command_prefix='!') async def connect(): print('Logging in...') try: await bot.start(token) except: print('Failed to login.') bot.loop.close() @bot.event async def on_ready(): print('Logged in as') print(bot.user.name) print(bot.user.id) print( f'https://discordapp.com/oauth2/authorize?client_id={bot.user.id}&scope=bot&permissions=16' ) print('------') @bot.command()
import discord from discord.ext import commands import asyncio import pyson import re import random from datetime import datetime import time bot = commands.Bot(command_prefix='.') config = pyson.Pyson('data.json') trivia = pyson.Pyson('QnA.json') token = config.data.get('config').get('token') users = config.data.get('users') boottime = datetime.now() version = '0.0.9' @bot.event async def on_ready(): print('Logged in as: ' + bot.user.name) print('Bot ID: ' + bot.user.id) print('Invite Link Below') print('------') print( 'https://discordapp.com/oauth2/authorize?client_id={}&scope=bot&permissions=0' .format(bot.user.id)) print('------') for server in bot.servers: print("Connected to server: {} with id: {}".format(server, server.id)) for member in server.members:
from discord.ext import commands import discord import asyncio import pyson config = pyson.Pyson('tasks.json') tasks = config.data.get('tasklist') token = 'token' bot = commands.Bot(command_prefix='!') @bot.event async def on_ready(): print('Logged in as: ' + bot.user.name) print('Bot ID: ' + bot.user.id) async def connect(): print('Logging in...') while not bot.is_closed: try: await bot.start(token) except: await asyncio.sleep(5) @bot.command(pass_context=True, aliases=['tl', 'tasklist']) async def task(ctx, task_name: str = None, ): """!task - lists all tasks not closed, if followed by task will give details for said task