Skip to content
This repository has been archived by the owner on Apr 15, 2022. It is now read-only.

Commit

Permalink
disabled $clear because of bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
joseywoermann committed Jan 2, 2021
1 parent 32c8249 commit 54af44e
Showing 1 changed file with 44 additions and 9 deletions.
53 changes: 44 additions & 9 deletions bot.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import schedule
import discord
import random
from discord.ext import commands
Expand All @@ -7,12 +8,15 @@
import datetime
import requests
from bs4 import BeautifulSoup
import logging
import threading



# -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------



intents = discord.Intents.all()

client = commands.Bot(command_prefix='$', intents = intents)
Expand All @@ -21,7 +25,7 @@

statuss = ['navnlos.tk', '$help']
statusmsg = cycle(statuss)
TOKEN = 'YOU TOKEN HERE'
TOKEN = 'YOUR TOKEN HERE'



Expand Down Expand Up @@ -187,7 +191,6 @@ async def on_message(message):
await message.channel.purge(limit=1)
await message.channel.send("Dieses Wort ist auf diesem Server verboten.")
"""

await client.process_commands(message)


Expand Down Expand Up @@ -242,7 +245,6 @@ async def change_status():
await client.change_presence(status=discord.Status.online,activity=discord.Activity(type=discord.ActivityType.listening, name=next(statusmsg)))



#-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


Expand Down Expand Up @@ -1110,12 +1112,13 @@ async def serverinfo(ctx):
# -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


@client.command(aliases=['c'])
@client.command()
@commands.has_permissions(manage_messages=True)
@commands.guild_only()
async def clear(ctx, amount_typed=1, arg=' '):

async def clear(ctx): #, amount_typed=1, arg=' '

await ctx.send("Dieser Command wurde temporär deaktiviert, um Fehler zu beheben.")
"""
clear_pin_embed = discord.Embed(title=str(amount_typed) + " Nachricht(en) wurden geloescht.", color=discord.Color.dark_red())
clear_pin_embed.set_author(name=str(ctx.author), icon_url=ctx.author.avatar_url)
Expand Down Expand Up @@ -1149,8 +1152,7 @@ async def clear(ctx, amount_typed=1, arg=' '):
await ctx.send(content=None, embed=clear_overflow_embed)
sleep(1)
await ctx.channel.purge(limit=2)


"""

@client.command(aliases=['k'])
@commands.has_permissions(kick_members=True)
Expand Down Expand Up @@ -1282,7 +1284,7 @@ async def nickedit(ctx, mensch: discord.Member, newname):

except:

pass #errormessage einfuegen
pass#errormessage einfuegen

else:
pass
Expand Down Expand Up @@ -1400,3 +1402,36 @@ async def dummy(ctx):
#-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

client.run(TOKEN)





"""
# KGH-notifier
def notifier():
print("notifier active")
URL = "http://kreisgymnasium-halle.de/"
refresh_time = 60
logging.basicConfig(format='%(asctime)s %(message)s', datefmt='%Y-%m-%d; %H:%M:%S')
while True:
page = requests.get(URL)
old_page = BeautifulSoup(page.content, 'html.parser')
old_content = old_page.find('div', attrs={'class': 'site-main'})
sleep(refresh_time)
page = requests.get(URL)
new_page = BeautifulSoup(page.content, 'html.parser')
new_content = new_page.find('div', attrs={'class': 'site-main'})
if old_content == new_content:
logging.warning(": nothing changed")
else:
logging.warning(": something changed")
"""

0 comments on commit 54af44e

Please sign in to comment.