Skip to content
Permalink
master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
# Lukas code starts here
import discord
"""Discord.py is a library used to communicate with discord and control your bot.
Source: https://github.com/Rapptz/discord.py"""
from discord.ext import commands
"""A part of the discord.py library that introduces bot (or user) commands you can use for easier control."""
import logging
from main_function import Main_function
logging.basicConfig(level=logging.INFO) # Outputs basic log on the server side
TOKEN = "Mzc1MjU4NTE4NjYxNDk2ODMy.DPhj5A.wNcnniW9oibG4rcX6N7YNXJb6yM" # Unique to every bot, needed to authorise and run
CHANNEL = "375284753613455361" # Testing channel ID
description = '''A ChatBot made for ALL project'''
bot = commands.Bot(command_prefix='~', description=description) # Initializes bot object, specifies command prefix (~) and description
# This specific @bot.event (on_ready()) was taken from the basic_bot.py example in the discord.py repository.
@bot.event
async def on_ready():
print('------\nLogged in as')
print(bot.user.name)
print(bot.user.id)
print('------')
@bot.event
async def on_message(message):
if message.author != bot.user:
msg = Main_function(message.content)
await bot.send_message(bot.get_channel(CHANNEL), msg)
bot.run(TOKEN)
# Lukas code ends here