--- tags: csc --- {%hackmd theme-dark %} # CSCbook For learning Python at `Fudan Computer Science Club`. ## Notes [[PYTHON] 基礎語法篇](https://happylearningcoding.blogspot.com/2020/07/python.html) [[PYTHON] DICT 篇](https://happylearningcoding.blogspot.com/2020/07/python-dict.html) [[PYTHON] LIST 篇](https://happylearningcoding.blogspot.com/2020/07/python-list.html) [[PYTHON] STRING 篇](https://happylearningcoding.blogspot.com/2020/07/python-string.html) ## 上學期課程 ### Presentation - [Computer Science Club (1)](/@gtcoding/csc) - [Computer Science Club (2)](/@gtcoding/csc2) - [Computer Science Club (3)](/@gtcoding/csc3) - [Computer Science Club (6)](/@gtcoding/csc6) ## 下學期課程 ### Handout - [PYTHON and Discord Bot Tutorial](/@gtcoding/discord) ### Presentation - [Computer Science Club (7)](/@gtcoding/csc7) ## Online IDE - repl.it ## Discord 伺服器邀請連結 [Link](https://discord.gg/yxuVzwyS6j) ## Discord Developers [Link](https://discord.com/developers/applications) ## 匿名提問 & 閒聊系統 Slido [Link](https://app.sli.do/event/ahorazj1) ## Supplement ### TOKEN ![](https://i.imgur.com/4kXyAQe.png) ### Code ```python= import discord from discord.ext import commands bot = commands.Bot(command_prefix = '$') # 宣告 bot bot.remove_command('help') # 移除 built-in function @bot.event async def on_ready(): print('>> Bot is online ') bot.run('TOKEN') # 你的 TOKEN ``` ### Json File ```python= import json with open('setting.json', 'r', encoding = 'utf8') as jFile: jdata = json.load(jFile) ``` ```json= { "TOKEN": "NjgxMDQ3NzE1MzcwNTAwMTY0.XlI2jw.kDLEiVbXgK6T6jmggqKqZ9EkK6Q", "FORM": "★,,♫◦★,,♫◦HELP選單♫◦,,★,,♫◦★", "STICKER": "https://hips.hearstapps.com/cosmouk.cdnds.net/15/21/nrm_1432138418-o-poop-emoji-ice-cream-facebook.jpg" } ``` ```python= jdata['FORM'] jdata['TOKEN'] jdata['STKCKER'] ``` <!-- https://slides.com/piepie01/deck-0f8933 -->