First command for pi and update .gitignore to remove pi.txt (too big)

This commit is contained in:
louis chauvet 2018-08-31 19:19:44 +02:00
parent e18c54baee
commit c1241e3734
3 changed files with 19 additions and 4 deletions

3
.gitignore vendored
View File

@ -108,3 +108,6 @@ venv.bak/
# FoBot config
foBot_config/*
# Pi file (too big)
modules/pi/pi.txt

View File

@ -1,11 +1,24 @@
import os
class MainClass:
name = "pi"
def __init__(self, guild):
self.guild = guild
self.pi_file = "D:\\Users\\louis chauvet\\Documents\\GitHub\\foBot\\modules\\pi\\pi1.txt"
async def pi(self, msg, command, args):
pass
start=0
if len(args) == 1:
try:
start = int(args[0])
except ValueError:
await msg.channel.send("Vous devez spwcifier un nombre imferieur a 100000")
with open(self.pi_file) as pi_file:
pi_file.read(start)
txt = pi_file.read(1900)
await msg.channel.send("3."+txt)
async def pi_search(self, msg, command, args):
pass
@ -14,5 +27,5 @@ class MainClass:
if msg.content.startswith(self.guild.config["prefix"]):
command, *args = msg.content.lstrip(self.guild.config["prefix"]).split(" ")
if command == "pi":
self.pi(msg, command, args)
return
await self.pi(msg, command, args)
return

File diff suppressed because one or more lines are too long