CSCbook

For learning Python at Fudan Computer Science Club.

Notes

[PYTHON] 基礎語法篇
[PYTHON] DICT 篇
[PYTHON] LIST 篇
[PYTHON] STRING 篇

上學期課程

Presentation

下學期課程

Handout

Presentation

Online IDE

Discord 伺服器邀請連結

Link

Discord Developers

Link

匿名提問 & 閒聊系統 Slido

Link

Supplement

TOKEN

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

Code

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

import json with open('setting.json', 'r', encoding = 'utf8') as jFile: jdata = json.load(jFile)
{ "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" }
jdata['FORM'] jdata['TOKEN'] jdata['STKCKER']