mirror of
https://github.com/Floriansylvain/Risitas_BOT.git
synced 2026-08-19 19:53:19 +02:00
La souffrance v2
This commit is contained in:
@@ -1,8 +1,6 @@
|
|||||||
import discord
|
|
||||||
import asyncio
|
import asyncio
|
||||||
import socket
|
import socket
|
||||||
import re
|
import re
|
||||||
import signal
|
|
||||||
from time import sleep
|
from time import sleep
|
||||||
from discord.ext import tasks, commands
|
from discord.ext import tasks, commands
|
||||||
from private import *
|
from private import *
|
||||||
@@ -22,7 +20,7 @@ def check_user(name):
|
|||||||
return False
|
return False
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def chat_init(twitch_chan, ctx):
|
def chat_init(twitch_chan):
|
||||||
global SOCK
|
global SOCK
|
||||||
if check_user(twitch_chan):
|
if check_user(twitch_chan):
|
||||||
try:
|
try:
|
||||||
@@ -33,7 +31,7 @@ def chat_init(twitch_chan, ctx):
|
|||||||
SOCK.settimeout(0.0)
|
SOCK.settimeout(0.0)
|
||||||
SOCK.setblocking(0)
|
SOCK.setblocking(0)
|
||||||
return 1
|
return 1
|
||||||
except:
|
except OSError:
|
||||||
return('```Impossible de se connecter au chat IRC de Twitch.```')
|
return('```Impossible de se connecter au chat IRC de Twitch.```')
|
||||||
return('```Cette chaine n\'existe pas. Verifiez l\'orthographe ou la syntaxe.```')
|
return('```Cette chaine n\'existe pas. Verifiez l\'orthographe ou la syntaxe.```')
|
||||||
|
|
||||||
@@ -106,7 +104,7 @@ async def chat_set(ctx, arg1, argF=None):
|
|||||||
global TASK
|
global TASK
|
||||||
if argF is None:
|
if argF is None:
|
||||||
if TASK is None:
|
if TASK is None:
|
||||||
test = chat_init(arg1, ctx)
|
test = chat_init(arg1)
|
||||||
if type(test) is int and test == 1:
|
if type(test) is int and test == 1:
|
||||||
await ctx.send(f'```Connection à la chaine {arg1} réussie !```')
|
await ctx.send(f'```Connection à la chaine {arg1} réussie !```')
|
||||||
TASK = bot.loop.create_task(twitch(ctx))
|
TASK = bot.loop.create_task(twitch(ctx))
|
||||||
|
|||||||
Reference in New Issue
Block a user