async def connectForSound(self, member, f): '''Connects to the voice channel the given member is in, and plays the given file''' commands.HelpCommand() if (isfile(join(config['Sounds']['ClipsDir'], f))): if (member.voice.channel): voice = await member.voice.channel.connect() source = discord.PCMVolumeTransformer( discord.FFmpegPCMAudio( join(config['Sounds']['ClipsDir'], f))) voice.play(source) while (voice.is_playing()): None await voice.disconnect() else: print("N8 f****d up the file name")
#!/usr/bin/python3 import discord from discord.ext import commands import sys, traceback, os PREFIX = "*" bot = commands.Bot(command_prefix=PREFIX) formatter = commands.HelpCommand(show_check_failure=False) exts = [ #"espn.__init__", #"plex.__init_plex__", #"plex.__init_manager__", #"plex.__init_manager_nodb__", #"core.manager", #"jellyfin.__init__", #"emby.__init__", #"news.__init__", #"MARTA.__init__", #"booksonic.__init__", #"roles.__init__", #"yahoofantasy.__init__", #"smart_home.sengled_lights.__init__", #"smart_home.google_home.__init__", #"smart_home.wink.__init__", #"general.__init__", ]
override.category = bot.fetch_channel( override_dict["category"]) override.position = override_dict["position"] final[guild_id][-1].overrides[int(number)] = override return final #TODO:pass xd def voice_channel_to_channel_override( channel: VoiceChannel) -> utils.ChannelOverride: pass #create bot instance bot = dcec.Bot('v!', dcec.HelpCommand()) #################### Events #################### @bot.event async def on_ready(): utils.print_timed("") print("Logged in as") print(bot.user.name) print(bot.user.id) print("------") f = open("infinityVoiceSaves.txt", "r") IV.infinityVoices = json_decoder(f.read()) print(IV.infinityVoices)
import discord import datetime import asyncio import random import json import urllib.request import urllib.parse import re import os import traceback from discord.ext import commands bot = commands.Bot(command_prefix="k!",help_command=commands.HelpCommand(command_attrs={'hidden': True})) client = discord.Client() citycodes = { "北海道": '016010', "青森県": '020010', "岩手県": '030010', "宮城県": '040010', "秋田県": '050010', "山形県": '060010', "福島県": '070010', "東京都": '130010', "神奈川県": '140010', "埼玉県": '110010', "千葉県": '120010', "茨城県": '080010', "栃木県": '090010', "群馬県": '100010',
def cog_unload(self): """When the cog is unloaded.""" # set back to default self.bot.help_command = commands.HelpCommand()
def surver(): with open('prefixes.json', 'r') as f: surver = json.load(f) return len(surver) token = "Hmm...?" client = discord.Client() bot = commands.Bot(command_prefix=get_prefix, description='여러 정보를 알려드리는 Who 봇입니다!!') permission = discord.Permissions bot.remove_command('help') commands.HelpCommand(context='help 명령어로 명령어들을 확인해보세요!!') Gamelist = cycle( ['.도움말!!', '.help!!', 'SNS는 인생의 낭비', f'사용하고 있는 서버 : 총 {surver()}개']) @tasks.loop(seconds=10.0) async def Change_status(): await bot.change_presence(activity=discord.Game(next(Gamelist))) @bot.command(hidden=True) async def on_command_error(ctx, error): if isinstance(error, commands.CommandNotFound): await ctx.send(embed=discord.Embed( title='명령어 에러!!',
async def custom_help(self, ctx, *args): pages = self.bot.formatter.format_help_for(ctx, self.bot) commands.HelpCommand( context=ctx, show_hidden=True, )