async def cmndstreamchannel(message): channels = (message.author.guild.voice_channels) emptychannels = False cpchannel = channels[0] for j in channels: if j.category.id == zz_init.config().get_IDcategoryvoice(): # Wenn Kategory richtig ist cpchannel = j await cpchannel.clone(name="Stream-Channel") channels = (message.author.guild.voice_channels) anzahl = len(channels) - 1 # -1, da Liste ab 0 beginnt #print(anzahl) await message.author.move_to(channels[anzahl]) return
import discord from discord.ext import commands from modules import zz_functions from modules import zz_init IDchannelstandard = zz_init.config().get_IDchannelstandard() IDchannelcommand = zz_init.config().get_IDchannelcommand() IDchannelverificate = zz_init.config().get_IDchannelverificate() IDgrpverificate = zz_init.config().get_IDgrpverificate() IDgrpnotify = zz_init.config().get_IDgrpnotify() class MembersCog(commands.Cog): def __init__(self, bot): self.bot = bot @commands.command(aliases=["hilfe"]) @commands.guild_only() async def help(self, ctx): if ctx.message.channel.id == IDchannelcommand: await zz_functions.cmndhelp(ctx.message) @commands.command() @commands.guild_only() async def notify(self, ctx): if ctx.message.channel.id == IDchannelcommand: await zz_functions.cmndnotify(ctx.message, ctx.guild)
import discord from discord.ext import commands from modules import zz_functions from modules import zz_init IDchanneladmin = zz_init.config().get_IDchanneladmin() IDchannelcommand = zz_init.config().get_IDchannelcommand() IDchannelcommand = zz_init.config().get_IDchannelcommand() IDchannelstandard = zz_init.config().get_IDchannelstandard() class MembersCog(commands.Cog): def __init__(self, bot): self.bot = bot @commands.command() @commands.guild_only() async def resetuser(self, ctx, arg=None): if ctx.message.channel.id == IDchanneladmin: if arg: await zz_functions.resetuser(ctx.message, arg) @commands.command() @commands.guild_only() async def customdbcommand(self, ctx, arg=None): text = ctx.message.content text = text.replace("!customdbcommand ", "") if ctx.message.channel.id == IDchanneladmin: if arg: #print(text) await zz_functions.customdbcommand(ctx.message, text)
async def pterodactylwritefile(serverid, path, data, apikey): url = zz_init.config().get_pterodactyl_domain() + 'api/client/servers/' + serverid + '/files/write?file='\ + urllib.parse.quote(path) requests.post(url, data=data, headers={"Accept": "application/json", "Authorization": "Bearer " + apikey})
async def syncwhitelistpterodactyl(whitelistyoutube, whitelisttwitch): paths = open("whitelist/youtube/pterodactyl.txt", "r") for line in paths: parts = line.split(" ") serverid = parts[0] whitelistpath = parts[1] await pterodactylwritefile(serverid, whitelistpath, json.dumps(whitelistyoutube), zz_init.config().get_pterodactyl_apikey()) paths.close() paths = open("whitelist/twitch/pterodactyl.txt", "r") for line in paths: parts = line.split(" ") serverid = parts[0] whitelistpath = parts[1] await pterodactylwritefile(serverid, whitelistpath, json.dumps(whitelisttwitch), zz_init.config().get_pterodactyl_apikey()) paths.close()
import discord import requests import json import math import urllib.parse from modules import zz_init import time from os import path from shutil import copyfile from random import randrange IDgrpverificate = zz_init.config().get_IDgrpverificate() IDgrpnotify = zz_init.config().get_IDgrpnotify() ArrayIDgrpsubyoutube = zz_init.config().get_ArrayIDgrpsubyoutube() ArrayIDgrpsubtwitch = zz_init.config().get_ArrayIDgrpsubtwitch() async def cmndhelp(message): await message.channel.send("""``` !mc [Name] - Registriere deinen Minecraft-Account !mcname [Name] - Gibt deinen aktuellen Minecraft-Account wieder !rank [Name] - Gibt Erfahrung wieder !anfrage - Schreibe dem Bot eine Anfrage, die direkt an die Moderatoren privat weitergeleitet werden```""") return async def newjoin(member): #hier sollte ein embed erzeugt werden return async def question(message, client): # print(message.author.dm_channel.me) # print("Test1")
#import discord import mysql.connector from modules import zz_init #test DBhost = zz_init.config().get_DBhost() DBuser = zz_init.config().get_DBuser() DBpasswd = zz_init.config().get_DBpasswd() DBdatabase = zz_init.config().get_DBdatabase() mydb = mysql.connector.connect(host=DBhost, user=DBuser, passwd=DBpasswd, database=DBdatabase, auth_plugin='mysql_native_password') mycursor = mydb.cursor() #create database mycursor.execute("CREATE DATABASE blizzbot") #create table mycursor.execute( "CREATE TABLE mcnames (id INT AUTO_INCREMENT PRIMARY KEY, discord_id BIGINT, minecraft_name TINYTEXT, uuid TINYTEXT, isWhitelistedYoutube BOOLEAN, isWhitelistedTwitch BOOLEAN)" ) mycursor.execute( "CREATE TABLE ranking (id INT AUTO_INCREMENT PRIMARY KEY, discord_id BIGINT, points INT)" )
import discord from modules import zz_setup from modules import zz_init from modules import zz_functions from random import randrange from discord.ext import commands from discord.utils import get intents = discord.Intents.all() zz_init.logger() token = zz_init.config().get_token() IDcategoryvoice = zz_init.config().get_IDcategoryvoice() IDcategorytext = zz_init.config().get_IDcategorytext() IDchannelstandard = zz_init.config().get_IDchannelstandard() IDchannelcommand = zz_init.config().get_IDchannelcommand() IDchannelverificate = zz_init.config().get_IDchannelverificate() IDchanneladmin = zz_init.config().get_IDchanneladmin() IDchannellogs = zz_init.config().get_IDchannellogs() IDchannelanfrage = zz_init.config().get_IDchannelanfrage() IDgrpverificate = zz_init.config().get_IDgrpverificate() IDgrpnotify = zz_init.config().get_IDgrpnotify() IDgrpYT = zz_init.config().get_IDgrpYT() IDgrpYTGold = zz_init.config().get_IDgrpYTGold() IDgrpYTDiamant = zz_init.config().get_IDgrpYTDiamant() IDgrpMod = zz_init.config().get_IDgrpMod() IDguildCommunity = zz_init.config().get_IDguildCommunity()