bot can now reply and randomly send messages + some little changes
This commit is contained in:
parent
16c847fe98
commit
5abbb2d36a
43
bot_newest_version/bot_messages.txt
Normal file
43
bot_newest_version/bot_messages.txt
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
have anyeone seen @random?
|
||||||
|
does anybody know what is @random doing?
|
||||||
|
DO YOU EVEN LIFT @random?!??!??
|
||||||
|
I love seals! @random do you love seals too?
|
||||||
|
@random is sus
|
||||||
|
you really need to relax @random
|
||||||
|
I’ve seen the future
|
||||||
|
I am not a bot!
|
||||||
|
you really need to study right now
|
||||||
|
sorry if i ever said anything misleading
|
||||||
|
the flowers are literally blooming right now
|
||||||
|
everything you said today is an act of violence
|
||||||
|
I am gonna
|
||||||
|
I am about to
|
||||||
|
we really need to talk
|
||||||
|
uwu~
|
||||||
|
chairs
|
||||||
|
Flowers!
|
||||||
|
the floor
|
||||||
|
look, the ceiling is falling!
|
||||||
|
watch out! You almost got a nice feeling about your life
|
||||||
|
image dragON THESE BALLS
|
||||||
|
Xd
|
||||||
|
the sun is a deadly laser
|
||||||
|
the confusion is getting bigger and bigger
|
||||||
|
You should really think about your life
|
||||||
|
I think it’s great time to leave the school and never come back
|
||||||
|
all you need is to start a new life somewhere where nobody knows you
|
||||||
|
let’s travel through time
|
||||||
|
this chat is very insulting
|
||||||
|
I have never seen anything sussier than you guys
|
||||||
|
the sussyness has been rapidly increasing lately
|
||||||
|
we ran out of toilet paper
|
||||||
|
Let’s play some minecraft
|
||||||
|
PIWO PIWO PIWO
|
||||||
|
7 ships are cruising the Sahara desert
|
||||||
|
the enchanting table is free to use
|
||||||
|
ancient recipies are blessing us to be free
|
||||||
|
sometimes, it’s just hard to fall asleep
|
||||||
|
when gamenight?
|
||||||
|
Horác is really playful
|
||||||
|
sometimes, it’s even hard to shit
|
||||||
|
It’s <time>
|
42
bot_newest_version/bot_reply_messages.txt
Normal file
42
bot_newest_version/bot_reply_messages.txt
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
that is funny
|
||||||
|
nice
|
||||||
|
cool
|
||||||
|
yeah I know
|
||||||
|
why?
|
||||||
|
oh, I see
|
||||||
|
that is so cute actually
|
||||||
|
i don’t know why you are saying that
|
||||||
|
ok let’s see
|
||||||
|
let’s go!
|
||||||
|
you little sus
|
||||||
|
the doors are open so why don’t you leave?
|
||||||
|
7, to be exact
|
||||||
|
oh god
|
||||||
|
here we go again
|
||||||
|
xd
|
||||||
|
so true
|
||||||
|
indeed
|
||||||
|
absolutely not!
|
||||||
|
It’s well known that it’s not like that
|
||||||
|
YMCA!
|
||||||
|
not true
|
||||||
|
you liar!
|
||||||
|
what a lie!
|
||||||
|
you are out
|
||||||
|
what an outstanding opinion
|
||||||
|
what did I say?
|
||||||
|
oh
|
||||||
|
yes
|
||||||
|
no
|
||||||
|
maybe
|
||||||
|
sure
|
||||||
|
why not
|
||||||
|
okay
|
||||||
|
ok
|
||||||
|
ok, see you later!
|
||||||
|
i don’t think so
|
||||||
|
are you trying to harass me?
|
||||||
|
Am I supposed to take that offensive?
|
||||||
|
of course not
|
||||||
|
hell yeah
|
||||||
|
Bro really said <mentioner_message>
|
@ -2,6 +2,10 @@ slova = ["nigga", "negr", "debil", "gay", "kokot", "ok", "kurva", "sus", "petr",
|
|||||||
|
|
||||||
sus_responses = ["it's getting sus here", "sus", "you are sussy", "sussy baka", "that is kinda sus", "that is sus", "you're seeming sus lately", "seems sus", "SUS", "gobus amogus", "amongsus", "sussy ah", "sussy"] #variety of responses when sus detection
|
sus_responses = ["it's getting sus here", "sus", "you are sussy", "sussy baka", "that is kinda sus", "that is sus", "you're seeming sus lately", "seems sus", "SUS", "gobus amogus", "amongsus", "sussy ah", "sussy"] #variety of responses when sus detection
|
||||||
|
|
||||||
greetings =['čau', 'ahoj', 'hi', 'hello', 'high', 'čauky', 'nazdar', 'dobrý den','helou']
|
greetings =['čau', 'ahoj', 'hi', 'hello', 'high', 'čauky', 'nazdar', 'dobrý den', 'helou']
|
||||||
|
|
||||||
main_channels_ids = ["1043499633118285825", "834034469152882729"]
|
main_channels_ids = [1043499633118285825, 834034469152882729]
|
||||||
|
|
||||||
|
bot_messages = open("bot_messages.txt", "r").readlines()
|
||||||
|
|
||||||
|
bot_reply_messages = open("bot_reply_messages.txt", "r").readlines()
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import discord, time, random, os
|
import discord, time, random, os
|
||||||
from discord.ext import commands, tasks
|
from discord.ext import commands, tasks
|
||||||
from config import slova, sus_responses, greetings, main_channels_ids
|
from config import slova, sus_responses, greetings, main_channels_ids, bot_messages, bot_reply_messages
|
||||||
|
|
||||||
t_h = 0
|
t_h = 0
|
||||||
t_s = 0
|
t_s = 0
|
||||||
@ -14,8 +14,27 @@ client = commands.Bot(command_prefix = '~', intents=intents)
|
|||||||
##############################################################################################################
|
##############################################################################################################
|
||||||
##################################### COMMNADS AND FUNCTIONS SCRIPTS #########################################
|
##################################### COMMNADS AND FUNCTIONS SCRIPTS #########################################
|
||||||
##############################################################################################################
|
##############################################################################################################
|
||||||
async def chat_participation(message): #randmonly sends messages into main channels
|
async def chat_participation(): #randmonly sends messages into main channels
|
||||||
print("oiasndiuhsa iundhusia nhdoiusah iunasohndui sahndiu hasiduhnuiasodhna sdiyu nhasiudh niuashndiuahsniu dhniasuh")
|
for idd in main_channels_ids:
|
||||||
|
channel = client.get_channel(idd)
|
||||||
|
|
||||||
|
members = channel.members
|
||||||
|
members_ids = []
|
||||||
|
for member in members:
|
||||||
|
members_ids.append(member.id)
|
||||||
|
members_ids.remove(client.user.id)
|
||||||
|
rnid = random.choice(members_ids)
|
||||||
|
|
||||||
|
msg = (random.choice(bot_messages)).strip()
|
||||||
|
|
||||||
|
if "@random" in msg:
|
||||||
|
msg = msg.replace("@random", f"<@{rnid}>")
|
||||||
|
|
||||||
|
if "<time>" in msg:
|
||||||
|
msg = msg.replace("<time>", str(time.strftime("%H:%M:%S",time.localtime())))
|
||||||
|
|
||||||
|
await channel.send(msg)
|
||||||
|
print("|RAND CHAT PARTICIPATION| Bot sent: {}".format(msg))
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
@ -44,7 +63,7 @@ async def word_counter(message): #counts words in word list
|
|||||||
file = open(file_path, 'w')
|
file = open(file_path, 'w')
|
||||||
file.write(str(pocet))
|
file.write(str(pocet))
|
||||||
file.close()
|
file.close()
|
||||||
print("added in", file_path, count, ", celkove", open(file_path, "r").read())
|
print("|WORD COUNTER| Added {} to {}, in total: {}".format(count, file_path, open(file_path, "r").read()))
|
||||||
|
|
||||||
else:
|
else:
|
||||||
pass
|
pass
|
||||||
@ -61,7 +80,7 @@ async def count_reader(message): #count command returns message w
|
|||||||
msg = ''
|
msg = ''
|
||||||
|
|
||||||
if len(obsah) != 2:
|
if len(obsah) != 2:
|
||||||
print('function ~count got ivalid input:', message.content)
|
print('|COUNT READER| Function ~count got ivalid input: {}'.format(message.content))
|
||||||
await message.channel.send('invalid input')
|
await message.channel.send('invalid input')
|
||||||
return
|
return
|
||||||
|
|
||||||
@ -80,13 +99,13 @@ async def count_reader(message): #count command returns message w
|
|||||||
else:
|
else:
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
print('word in not in word list')
|
print('|COUNT READER| Searched word is not in word list')
|
||||||
await message.channel.send('word is not in word list')
|
await message.channel.send('your desired word is not in word list')
|
||||||
return
|
return
|
||||||
|
|
||||||
if files == []:
|
if files == []:
|
||||||
print('word is in the list, but there are no records')
|
print('|COUNT READER| Word is in the list, but there are no records')
|
||||||
await message.channel.send('word is in the list, but there are no records')
|
await message.channel.send('your desired word is in the list, but there are no records')
|
||||||
return
|
return
|
||||||
|
|
||||||
else:
|
else:
|
||||||
@ -121,7 +140,7 @@ async def primenum_command(message): #primenumbers scri
|
|||||||
|
|
||||||
vstup = int(message.content.split("~primenum ",1)[1])
|
vstup = int(message.content.split("~primenum ",1)[1])
|
||||||
|
|
||||||
print('number:', vstup)
|
print('|PRIMENUM| Input: {}'.format(vstup))
|
||||||
|
|
||||||
delitel = 1
|
delitel = 1
|
||||||
vst_up = int(vstup / 2) #vstup děleno dvěmi
|
vst_up = int(vstup / 2) #vstup děleno dvěmi
|
||||||
@ -156,7 +175,7 @@ async def primenum_command(message): #primenumbers scri
|
|||||||
answer = vystup + str('\nNumber %d IS NOT a prime number.' % (vstup))
|
answer = vystup + str('\nNumber %d IS NOT a prime number.' % (vstup))
|
||||||
|
|
||||||
await message.channel.send(answer)
|
await message.channel.send(answer)
|
||||||
print('Bot send:', answer)
|
print('|PRIMENUM| Bot sent: {}'.format(answer))
|
||||||
|
|
||||||
|
|
||||||
#
|
#
|
||||||
@ -168,8 +187,8 @@ async def scprove_command(message): #scientists prove that... sc
|
|||||||
|
|
||||||
input_message = str(message.content.split('~scprove',1)[1])
|
input_message = str(message.content.split('~scprove',1)[1])
|
||||||
|
|
||||||
output = str('Scientists prove that') + input_message + ('.')
|
output = str('scientists prove that') + input_message
|
||||||
print('Bot send:', output)
|
print('|SCPROVE| Bot sent: {}'.format(output))
|
||||||
await message.channel.send(output)
|
await message.channel.send(output)
|
||||||
|
|
||||||
#
|
#
|
||||||
@ -214,8 +233,8 @@ async def greetings_function(message): #greetings function
|
|||||||
if t_h + 30 < time.time():
|
if t_h + 30 < time.time():
|
||||||
for g in greetings:
|
for g in greetings:
|
||||||
if message.content.lower().startswith(g):
|
if message.content.lower().startswith(g):
|
||||||
await message.channel.send('Hello')
|
await message.channel.send(random.choice(greetings))
|
||||||
print('Expressed greetings to:', message.author.name, '(id:', message.author.id,')')
|
print('|GREETINGS| Expressed greetings to: {} (id: {})'.format(message.author.name, message.author.id))
|
||||||
t_h = time.time()
|
t_h = time.time()
|
||||||
else:
|
else:
|
||||||
pass
|
pass
|
||||||
@ -232,7 +251,7 @@ async def sus_function(message): #sus function
|
|||||||
if t_s + 20 < time.time():
|
if t_s + 20 < time.time():
|
||||||
if ('sus') in (message.content).lower() and message.content[0] != '~':
|
if ('sus') in (message.content).lower() and message.content[0] != '~':
|
||||||
await message.channel.send(sus_responses[random.randrange(0,len(sus_responses))])
|
await message.channel.send(sus_responses[random.randrange(0,len(sus_responses))])
|
||||||
print('Detected sus from:', message.author.name, '(id:', message.author.id, ')')
|
print('|SUS FUNC| Detected sus from: {} (id: {})'.format(message.author.name, message.author.id))
|
||||||
t_s = time.time()
|
t_s = time.time()
|
||||||
else:
|
else:
|
||||||
pass
|
pass
|
||||||
@ -242,17 +261,15 @@ async def sus_function(message): #sus function
|
|||||||
##############################################################################################################
|
##############################################################################################################
|
||||||
##################################### RUNNING THE FUNCTIONS AND COMMANDS #####################################
|
##################################### RUNNING THE FUNCTIONS AND COMMANDS #####################################
|
||||||
##############################################################################################################
|
##############################################################################################################
|
||||||
@tasks.loop(seconds = 3)
|
@tasks.loop(minutes = 10)
|
||||||
async def myloop():
|
async def myloop():
|
||||||
if random.randrange(0,10) == random.randrange(0,10):
|
if random.randrange(0,1200) == random.randrange(0,1200):
|
||||||
for id in main_channels_ids:
|
await chat_participation()
|
||||||
channel = client.get_channel(id = id)
|
|
||||||
await channel.send(random.choice(sus_responses))
|
|
||||||
|
|
||||||
|
|
||||||
@client.event #ready message cmd
|
@client.event #ready message cmd
|
||||||
async def on_ready():
|
async def on_ready():
|
||||||
print("Logged in as {0.user}".format(client))
|
print("Logged in as {0.user}!!!".format(client))
|
||||||
myloop.start()
|
myloop.start()
|
||||||
|
|
||||||
|
|
||||||
@ -260,13 +277,18 @@ async def on_ready():
|
|||||||
async def on_message(message):
|
async def on_message(message):
|
||||||
if message.author == client.user or message.channel.id not in main_channels_ids:
|
if message.author == client.user or message.channel.id not in main_channels_ids:
|
||||||
return
|
return
|
||||||
else:
|
|
||||||
|
|
||||||
await greetings_function(message)
|
|
||||||
await sus_function(message)
|
|
||||||
await word_counter(message)
|
|
||||||
|
|
||||||
await client.process_commands(message) #this line is very fuqacking important
|
else:
|
||||||
|
if client.user.mentioned_in(message):
|
||||||
|
reply = (random.choice(bot_reply_messages)).strip()
|
||||||
|
await message.reply(reply)
|
||||||
|
print("|REPLIED| Bot replied: {}".format(reply))
|
||||||
|
else:
|
||||||
|
await greetings_function(message)
|
||||||
|
await sus_function(message)
|
||||||
|
await word_counter(message)
|
||||||
|
|
||||||
|
await client.process_commands(message) #this line is very fuqacking important
|
||||||
|
|
||||||
|
|
||||||
@client.command()
|
@client.command()
|
||||||
|
Loading…
Reference in New Issue
Block a user